Freeciv-3.1
|
#include <QMouseEvent>
#include <QPainter>
#include <QPixmap>
#include <QToolTip>
#include <QWheelEvent>
#include "log.h"
#include "support.h"
#include "calendar.h"
#include "game.h"
#include "map.h"
#include "research.h"
#include "climisc.h"
#include "mapctrl_common.h"
#include "menu.h"
#include "movement.h"
#include "overview_common.h"
#include "sprite.h"
#include "repodlgs.h"
#include "text.h"
#include "zoom.h"
#include "colors.h"
#include "fc_client.h"
#include "gui_main.h"
#include "mapview.h"
#include "qtg_cxxside.h"
#include "sidebar.h"
Go to the source code of this file.
Macros | |
#define | MAX_DIRTY_RECTS 20 |
Variables | |
static int | mapview_frozen_level = 0 |
struct canvas * | canvas |
static int | num_dirty_rects = 0 |
static QRect | dirty_rects [MAX_DIRTY_RECTS] |
int | last_center_enemy |
int | last_center_capital |
int | last_center_player_city |
int | last_center_enemy_city |
#define MAX_DIRTY_RECTS 20 |
Definition at line 59 of file mapview.cpp.
|
extern |
Closes city dialog
Definition at line 3736 of file citydlg.cpp.
Referenced by qtg_popdown_all_city_dialogs(), qtg_popdown_city_dialog(), city_dialog::refresh(), and tileset_changed().
void dirty_all | ( | void | ) |
Mark the entire screen area as "dirty" so that we can flush it later.
Definition at line 1161 of file mapview.cpp.
Referenced by mapview_thaw().
void dirty_rect | ( | int | canvas_x, |
int | canvas_y, | ||
int | pixel_width, | ||
int | pixel_height | ||
) |
Mark the rectangular region as "dirty" so that we know to flush it later.
Definition at line 1143 of file mapview.cpp.
void draw_calculated_trade_routes | ( | QPainter * | painter | ) |
Draws calculated trade routes
Definition at line 82 of file mapview.cpp.
Referenced by map_view::paint().
void draw_selection_rectangle | ( | int | canvas_x, |
int | canvas_y, | ||
int | w, | ||
int | h | ||
) |
Area Selection
Definition at line 1258 of file mapview.cpp.
void flush_dirty | ( | void | ) |
Flush all regions that have been previously marked as dirty. See dirty_rect and dirty_all. This function is generally called after we've processed a batch of drawing operations.
Definition at line 1174 of file mapview.cpp.
|
static |
Flush the given part of the canvas buffer (if there is one) to the screen.
Definition at line 1133 of file mapview.cpp.
Referenced by flush_dirty().
void get_overview_area_dimensions | ( | int * | width, |
int * | height | ||
) |
Return the dimensions of the area (container widget; maximum size) for the overview.
Definition at line 1290 of file mapview.cpp.
struct canvas * get_overview_window | ( | void | ) |
Return a canvas that is the overview window.
Definition at line 1123 of file mapview.cpp.
const char * get_timeout_label_text | ( | void | ) |
Get the text showing the timeout. This is generally displayed on the info panel.
Not re-entrant
Definition at line 1590 of file text.c.
Referenced by qtg_update_timeout_label(), and update_timeout_label().
void gui_flush | ( | void | ) |
Do any necessary synchronization to make sure the screen is up-to-date. The canvas should have already been flushed to screen via flush_dirty - all this function does is make sure the hardware has caught up.
Definition at line 1198 of file mapview.cpp.
|
static |
Converts gui to overview position.
Definition at line 592 of file mapview.cpp.
Referenced by minimap_view::draw_viewport(), minimap_view::scale_point(), and unscale_point().
bool is_point_in_area | ( | int | x, |
int | y, | ||
int | px, | ||
int | py, | ||
int | pxe, | ||
int | pye | ||
) |
Check if point x, y is in area (px -> pxe, py - pye)
Definition at line 71 of file mapview.cpp.
Referenced by map_view::find_place().
void mapview_freeze | ( | void | ) |
Freeze the drawing of the map.
Definition at line 1336 of file mapview.cpp.
bool mapview_is_frozen | ( | void | ) |
Return whether the map should be drawn or not.
Definition at line 1328 of file mapview.cpp.
Referenced by dirty_all(), dirty_rect(), and flush_dirty().
void mapview_thaw | ( | void | ) |
Thaw the drawing of the map.
Definition at line 1344 of file mapview.cpp.
void overview_size_changed | ( | void | ) |
Called when the map size changes. This may be used to change the size of the GUI element holding the overview canvas. The overview.width and overview.height are updated if this function is called. It's used for first creation of overview only, later overview stays the same size, scaled by qt-specific function.
Definition at line 1304 of file mapview.cpp.
void pixmap_put_overlay_tile | ( | int | canvas_x, |
int | canvas_y, | ||
struct sprite * | ssprite | ||
) |
Put overlay tile to pixmap
Definition at line 1231 of file mapview.cpp.
Referenced by put_cross_overlay_tile().
void put_cross_overlay_tile | ( | struct tile * | ptile | ) |
Draw a cross-hair overlay on a tile.
Definition at line 1244 of file mapview.cpp.
void qtg_map_canvas_size_refresh | ( | void | ) |
Refresh map canvas size information
Definition at line 1461 of file mapview.cpp.
Referenced by setup_gui_funcs().
void qtg_start_turn | ( | ) |
void qtg_update_timeout_label | ( | void | ) |
Update the timeout display. The timeout is the time until the turn ends, in seconds.
Definition at line 1088 of file mapview.cpp.
Referenced by setup_gui_funcs().
void set_indicator_icons | ( | struct sprite * | bulb, |
struct sprite * | sol, | ||
struct sprite * | flake, | ||
struct sprite * | gov | ||
) |
Set information for the indicator icons typically shown in the main client window. The parameters tell which sprite to use for the indicator.
Definition at line 1114 of file mapview.cpp.
void tileset_changed | ( | void | ) |
This function is called when the tileset is changed.
Definition at line 1266 of file mapview.cpp.
void unscale_point | ( | double | scale_factor, |
int & | x, | ||
int & | y | ||
) |
Scales point from scaled overview coords to real overview coords.
Definition at line 715 of file mapview.cpp.
Referenced by minimap_view::mousePressEvent(), and minimap_thread::run().
void update_city_descriptions | ( | void | ) |
Update (refresh) all city descriptions on the mapview.
Definition at line 1223 of file mapview.cpp.
void update_info_label | ( | void | ) |
Typically an info box is provided to tell the player about the state of their civilization. This function is called when the label is changed.
Definition at line 992 of file mapview.cpp.
void update_map_canvas_scrollbars | ( | void | ) |
Update (refresh) the locations of the mapview scrollbars (if it uses them).
Definition at line 1207 of file mapview.cpp.
void update_map_canvas_scrollbars_size | ( | void | ) |
Update the size of the sliders on the scrollbars.
Definition at line 1215 of file mapview.cpp.
void update_mouse_cursor | ( | enum cursor_type | new_cursor_type | ) |
Update the mouse cursor. Cursor type depends on what user is doing and pointing.
Definition at line 1079 of file mapview.cpp.
void update_overview_scroll_window_pos | ( | int | x, |
int | y | ||
) |
Sets the position of the overview scroll window based on mapview position.
Definition at line 1320 of file mapview.cpp.
void update_turn_done_button | ( | bool | do_restore | ) |
If do_restore is false it should change the turn button style (to draw the user's attention to it). If called regularly from a timer this will give a blinking turn done button. If do_restore is true this should reset the turn done button to the default style.
Definition at line 1100 of file mapview.cpp.
void update_unit_info_label | ( | struct unit_list * | punitlist | ) |
Update the information label which gives info on the current unit and the tile under the current unit, for specified unit. Note that in practice punit is always the focus unit.
Clears label if punit is NULL.
Typically also updates the cursor for the map_canvas (this is related because the info label may includes "select destination" prompt etc). And it may call update_unit_pix_label() to update the icons for units on this tile.
Definition at line 1068 of file mapview.cpp.
Referenced by tileset_changed().
|
static |
Definition at line 61 of file mapview.cpp.
Referenced by dirty_rect(), and flush_dirty().
|
extern |
Definition at line 66 of file pages.cpp.
Referenced by qtg_start_turn().
|
extern |
Definition at line 79 of file pages.cpp.
Referenced by cycle_enemy_units(), and qtg_start_turn().
|
extern |
Definition at line 68 of file pages.cpp.
Referenced by center_next_enemy_city(), and qtg_start_turn().
|
extern |
Definition at line 67 of file pages.cpp.
Referenced by center_next_player_capital(), center_next_player_city(), and qtg_start_turn().
|
static |
Definition at line 55 of file mapview.cpp.
Referenced by mapview_freeze(), mapview_is_frozen(), and mapview_thaw().
|
static |
Definition at line 60 of file mapview.cpp.
Referenced by dirty_all(), dirty_rect(), and flush_dirty().