Freeciv-3.1
|
#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 "inputdlg.h"
#include "mapview.h"
#include "menu.h"
#include "mapctrl.h"
Go to the source code of this file.
Data Structures | |
struct | tmousepos |
Functions | |
static gboolean | popit_button_release (GtkWidget *w, GdkEventButton *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 | popup_newcity_dialog (struct unit *punit, const char *suggestname) |
void | set_turn_done_button_state (bool state) |
gboolean | butt_release_mapcanvas (GtkWidget *w, GdkEventButton *ev, gpointer data) |
gboolean | butt_down_mapcanvas (GtkWidget *w, GdkEventButton *ev, gpointer data) |
void | create_line_at_mouse_pos (void) |
void | update_rect_at_mouse_pos (void) |
gboolean | move_mapcanvas (GtkWidget *w, GdkEventMotion *ev, gpointer data) |
gboolean | leave_mapcanvas (GtkWidget *widget, GdkEventCrossing *event) |
gboolean | move_overviewcanvas (GtkWidget *w, GdkEventMotion *ev, gpointer data) |
gboolean | butt_down_overviewcanvas (GtkWidget *w, GdkEventButton *ev, gpointer data) |
void | center_on_unit (void) |
Variables | |
gint | cur_x |
gint | cur_y |
gboolean butt_down_mapcanvas | ( | GtkWidget * | w, |
GdkEventButton * | ev, | ||
gpointer | data | ||
) |
Handle all mouse button press on canvas. Future feature: User-configurable mouse clicks.
Definition at line 237 of file mapctrl.c.
Referenced by setup_widgets().
gboolean butt_down_overviewcanvas | ( | GtkWidget * | w, |
GdkEventButton * | ev, | ||
gpointer | data | ||
) |
gboolean butt_release_mapcanvas | ( | GtkWidget * | w, |
GdkEventButton * | ev, | ||
gpointer | data | ||
) |
Handle 'Mouse button released'. Because of the quickselect feature, the release of both left and right mousebutton can launch the goto.
Definition at line 216 of file mapctrl.c.
Referenced by setup_widgets().
void center_on_unit | ( | void | ) |
Best effort to center the map on the currently selected unit(s)
Definition at line 490 of file mapctrl.c.
Referenced by center_view_callback(), and center_view_callback().
void create_line_at_mouse_pos | ( | void | ) |
Update goto line so that destination is at current mouse pointer location.
Definition at line 347 of file mapctrl.c.
Referenced by base_set_mapview_origin(), request_unit_connect(), request_unit_goto(), request_unit_patrol(), and mr_menu::slot_delayed_goto().
gboolean leave_mapcanvas | ( | GtkWidget * | widget, |
GdkEventCrossing * | event | ||
) |
This function will reset the mouse cursor if it leaves the map.
Definition at line 429 of file mapctrl.c.
Referenced by setup_widgets().
gboolean move_mapcanvas | ( | GtkWidget * | w, |
GdkEventMotion * | ev, | ||
gpointer | data | ||
) |
Triggered by the mouse moving on the mapcanvas, this function will update the mouse cursor and goto lines.
Definition at line 400 of file mapctrl.c.
Referenced by setup_widgets().
gboolean move_overviewcanvas | ( | GtkWidget * | w, |
GdkEventMotion * | ev, | ||
gpointer | data | ||
) |
|
static |
Callback from city name dialog for new city.
Definition at line 173 of file mapctrl.c.
Referenced by popup_newcity_dialog().
|
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 118 of file mapctrl.c.
Referenced by butt_down_mapcanvas(), left_butt_down_mapcanvas(), and middle_butt_down_mapcanvas().
|
static |
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 194 of file mapctrl.c.
Referenced by handle_city_name_suggestion_info().
void popupinfo_popdown_callback | ( | GtkWidget * | w, |
gpointer | data | ||
) |
|
static |
void set_turn_done_button_state | ( | bool | state | ) |
Enable or disable the turn done button. Should probably some where else.
Definition at line 207 of file mapctrl.c.
Referenced by update_turn_done_button_state().
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 373 of file mapctrl.c.
Referenced by base_set_mapview_origin().
|
extern |
Definition at line 183 of file gui_main.c.
Referenced by move_mapcanvas(), and move_mapcanvas().
gint cur_y |
Definition at line 61 of file mapctrl.c.
Referenced by move_mapcanvas(), and move_mapcanvas().