Freeciv-3.3
|
#include <stdio.h>
#include <gtk/gtk.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "rand.h"
#include "support.h"
#include "timing.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "nation.h"
#include "player.h"
#include "client_main.h"
#include "climap.h"
#include "climisc.h"
#include "colors.h"
#include "control.h"
#include "editor.h"
#include "options.h"
#include "overview_common.h"
#include "tilespec.h"
#include "text.h"
#include "zoom.h"
#include "citydlg.h"
#include "editgui.h"
#include "graphics.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "mapctrl.h"
#include "repodlgs.h"
#include "wldlg.h"
#include "mapview.h"
Go to the source code of this file.
Variables | |
static GtkAdjustment * | map_hadj |
static GtkAdjustment * | map_vadj |
static int | cursor_timer_id = 0 |
static int | cursor_type = -1 |
static int | cursor_frame = 0 |
static int | mapview_frozen_level = 0 |
This function is used to animate the mouse cursor.
Definition at line 231 of file mapview.c.
Referenced by update_mouse_cursor().
Mark the entire screen area as "dirty" so that we can flush it later.
Definition at line 456 of file mapview.c.
Referenced by advance_global_anim_state(), base_set_mapview_origin(), dirty_rect(), mapview_thaw(), real_resize_window_callback(), unqueue_mapview_updates(), and update_city_descriptions().
Draws a rectangle with top left corner at (canvas_x, canvas_y), and width 'w' and height 'h'. It is drawn using the 'selection_gc' context, so the pixel combining function is XOR. This means that drawing twice in the same place will restore the image to its original state.
NB: A side effect of this function is to set the 'selection_gc' color to COLOR_MAPVIEW_SELECTION.
Definition at line 749 of file mapview.c.
Referenced by cancel_selection_rectangle(), define_tiles_within_rectangle(), editor_draw_selrect(), redraw_selection_rectangle(), and update_selection_rectangle().
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 468 of file mapview.c.
Referenced by add_global_worklist(), add_new_worklist_callback(), add_target_to_production(), add_target_to_worklist(), add_to_chat_list(), army_city_dlg_callback(), back_callback(), button_up_on_map(), call_meeting_dlg_callback(), cancel_disband_unit_callback(), cancel_help_dlg_callback(), cancel_pact_dlg_callback(), cancel_sdip_dlg_callback(), cancel_sell_impr_callback(), cancel_sld_cma_callback(), cancel_units_orders_city_dlg_callback(), cancel_upgrade_unit_callback(), cancel_upgrade_unit_callback(), city_report_dialog_popdown(), combo_popdown(), combo_popup(), convert_playername_callback(), convert_portnr_callback(), convert_servername_callback(), decrease_unit_hp_smooth(), disconnect_conn_callback(), economy_report_dialog_popup(), edit_worklist_callback(), editor_end_selection_rectangle(), exit_advanced_terrain_dlg_callback(), exit_change_tech_dlg_callback(), exit_cma_dialog_callback(), exit_economy_dialog_callback(), exit_find_city_dlg_callback(), exit_goto_dialog_callback(), exit_help_dlg_callback(), exit_image_popup_callback(), exit_intel_dlg_callback(), exit_notify_dialog_callback(), exit_players_dlg_callback(), exit_players_nations_dlg_callback(), exit_space_dialog_callback(), exit_units_dlg_callback(), find_city_callback(), flush_all(), goto_city_callback(), gui_recv_cancel_meeting(), happy_city_dlg_callback(), info_city_dlg_callback(), inside_scroll_down_loop(), inside_scroll_up_loop(), leader_name_edit_callback(), main_key_down_handler(), main_key_down_handler(), move_unit_map_canvas(), move_window_motion(), nation_button_callback(), new_name_city_dlg_callback(), newcity_cancel_callback(), newcity_name_edit_callback(), newcity_ok_callback(), next_name_callback(), next_prev_city_dlg_callback(), ok_buy_prod_city_dlg_callback(), ok_disband_unit_window_callback(), ok_upgrade_unit_window_callback(), options_city_dlg_callback(), popdown_bribe_dialog(), popdown_city_dialog(), popdown_hurry_production_dialog(), popdown_incite_dialog(), popdown_load_game_dialog(), popdown_newcity_dialog(), popdown_pillage_dialog(), popdown_start_menu(), popdown_terrain_info_dialog(), popdown_worklist_editor(), popup_connection_dialog(), popup_diplomacy_dialog(), popup_find_dialog(), popup_hurry_production_dialog(), popup_input_line(), popup_load_game_dialog(), popup_optiondlg(), popup_players_nations_dialog(), popup_sell_impr_callback(), popup_terrain_info_dialog(), popup_unit_disband_dlg(), popup_unit_upgrade_dlg(), popup_upgrade_unit_callback(), popup_war_dialog(), prev_name_callback(), put_nuke_mushroom_pixmaps(), races_dialog_cancel_callback(), races_dialog_ok_callback(), real_activeunits_report_dialog_update(), real_city_dialog_popup(), real_city_dialog_refresh(), real_city_report_dialog_update(), real_city_report_update_city(), real_conn_list_dialog_update(), real_info_city_report_dialog_update(), real_players_dialog_update(), real_science_report_dialog_update(), real_units_report_dialog_update(), refresh_spaceship_dialog(), refresh_unit_city_dialogs(), remove_item_from_worklist(), rename_worklist_editor_callback(), report_scroll_mouse_motion_handler(), save_cma_callback(), science_report_dialog_popdown(), scroll_mouse_motion_handler(), scroll_mouse_motion_handler(), sell_imprvm_dlg_callback(), sell_imprvm_dlg_cancel_callback(), sell_imprvm_dlg_ok_callback(), send_passwd_callback(), set_global_worklist(), set_mapview_origin(), style_callback(), supported_unit_city_dlg_callback(), swap_item_down_from_worklist(), swap_item_up_from_worklist(), toggle_map_window_callback(), toggle_msg_window_callback(), toggle_unit_info_window_callback(), unit_order_callback(), unit_select_dialog_popdown(), unqueue_flush(), unqueue_mapview_updates(), update_clauses_list(), update_diplomacy_dialog(), update_intel_dialog(), widget_pressed_action(), and withdraw_vision_dlg_callback().
Return the maximum dimensions of the area (container widget) for the overview. Due to the fact that the scaling factor is at least 1, the real size could be larger. The calculation in calculate_overview_dimensions() limit it to the smallest possible size.
Definition at line 317 of file mapview.c.
Referenced by calculate_overview_dimensions().
Return a canvas that is the overview window.
Definition at line 337 of file mapview.c.
Referenced by refresh_overview_from_canvas().
Get sprite for treaty acceptance or rejection.
Definition at line 292 of file mapview.c.
Referenced by update_diplomacy_dialog().
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 480 of file mapview.c.
Referenced by decrease_unit_hp_smooth(), move_unit_map_canvas(), put_nuke_mushroom_pixmaps(), and set_mapview_origin().
gboolean map_canvas_configure | ( | GtkWidget * | w, |
GdkEventConfigure * | ev, | ||
gpointer | data | ||
) |
Update on canvas widget size change
Definition at line 403 of file mapview.c.
Referenced by setup_widgets().
Refresh map canvas size information
Definition at line 414 of file mapview.c.
Referenced by map_canvas_resize(), and zoom_set().
Freeze the drawing of the map.
Definition at line 373 of file mapview.c.
Referenced by real_set_client_page().
Return whether the map should be drawn or not.
Definition at line 395 of file mapview.c.
Referenced by map_canvas_draw(), and map_canvas_draw().
Thaw the drawing of the map.
Definition at line 381 of file mapview.c.
Referenced by real_set_client_page().
Size of overview changed
Definition at line 326 of file mapview.c.
Referenced by calculate_overview_dimensions(), real_set_client_page(), and fc_client::switch_page().
void pixmap_put_overlay_tile | ( | GdkWindow * | pixmap, |
float | zoom, | ||
int | canvas_x, | ||
int | canvas_y, | ||
struct sprite * | ssprite | ||
) |
Put overlay tile to pixmap
Definition at line 543 of file mapview.c.
Referenced by put_cross_overlay_tile().
void pixmap_put_overlay_tile_draw | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
struct sprite * | ssprite, | ||
bool | fog | ||
) |
Only used for isometric view.
Definition at line 566 of file mapview.c.
Referenced by canvas_put_sprite_fogged().
Draws a cross-hair overlay on a tile
Definition at line 643 of file mapview.c.
Referenced by center_next_player_capital(), key_center_capital(), and unit_focus_set_and_select().
Fill image with unit gfx
Definition at line 496 of file mapview.c.
Referenced by city_dialog_update_present_units(), and set_unit_icon().
void put_unit_image_city_overlays | ( | struct unit * | punit, |
GtkImage * | p, | ||
int | height, | ||
int * | upkeep_cost, | ||
int | happy_cost | ||
) |
FIXME: For now only two food, two gold one shield and two masks can be drawn per unit, the proper way to do this is probably something like what Civ II does. (One food/shield/mask drawn N times, possibly one top of itself. – SKi
Definition at line 521 of file mapview.c.
Referenced by city_dialog_update_supported_units().
void scrollbar_jump_callback | ( | GtkAdjustment * | adj, |
gpointer | hscrollbar | ||
) |
Scrollbar has moved
Definition at line 721 of file mapview.c.
Referenced by update_map_canvas_scrollbars_size().
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 302 of file mapview.c.
Referenced by fc_client::update_info_label(), and update_info_label().
This function is called when the tileset is changed.
Definition at line 782 of file mapview.c.
Referenced by tilespec_reread().
Update display of descriptions associated with cities on the main map.
Definition at line 488 of file mapview.c.
Referenced by apply_city_names_font(), apply_city_productions_font(), apply_font(), gui_update_font(), handle_new_year(), and mr_menu::zoom_scale_fonts().
Refresh info label
Definition at line 138 of file mapview.c.
Referenced by handle_city_info(), handle_game_info(), handle_new_year(), handle_player_info(), handle_start_phase(), real_resize_window_callback(), real_set_client_page(), and set_client_state().
Refresh map canvas scrollbars
Definition at line 681 of file mapview.c.
Referenced by map_canvas_resized(), and set_mapview_origin().
Refresh map canvas scrollbar as canvas size changes
Definition at line 696 of file mapview.c.
Referenced by calculate_overview_dimensions(), map_canvas_resized(), and overview_size_changed().
void update_mouse_cursor | ( | enum cursor_type | new_cursor_type | ) |
This function will change the current mouse cursor.
Definition at line 257 of file mapview.c.
Referenced by button_down_on_map(), button_up_on_map(), control_mouse_cursor(), finger_down_on_map(), finger_up_on_map(), leave_mapcanvas(), leave_mapcanvas(), main_mouse_motion_handler(), map_event_handler(), map_event_handler(), and remove_net_input().
Sets the position of the overview scroll window based on mapview position.
Definition at line 657 of file mapview.c.
Referenced by center_tile_overviewcanvas().
Timeout label requires refreshing
Definition at line 118 of file mapview.c.
Referenced by real_timer_callback(), stop_turn_change_wait(), and update_info_label().
If do_restore is FALSE it will invert the turn done button style. If called regularly from a timer this will give a blinking turn done button. If do_restore is TRUE this will reset the turn done button to the default style.
Definition at line 76 of file mapview.c.
Referenced by blink_turn_done_button(), and update_turn_done_button_state().
Update the information label which gives info on the current unit and the square under the current unit, for specified unit. Note that in practice punit is always the focus unit. Clears label if punit is NULL. Also updates the cursor for the map_canvas (this is related because the info label includes a "select destination" prompt etc). Also calls update_unit_pix_label() to update the icons for units on this square.
Definition at line 275 of file mapview.c.
Referenced by client_remove_unit(), do_map_click(), do_move_unit(), focus_units_changed(), handle_city_info(), handle_new_year(), handle_unit_packet_common(), is_valid_goto_draw_line(), key_cancel_action(), key_unit_action_select_tgt(), leave_mapcanvas(), leave_mapcanvas(), paradrop_here_callback(), patrol_here_callback(), real_resize_window_callback(), real_set_client_page(), release_goto_button(), request_unit_connect(), request_unit_goto(), request_unit_paradrop(), request_unit_patrol(), request_unit_teleport(), and set_client_state().
|
static |
Definition at line 67 of file mapview.c.
Referenced by anim_cursor_cb(), and animate_mouse_cursor().
|
static |
Definition at line 67 of file mapview.c.
Referenced by anim_cursor_cb(), and update_mouse_cursor().
|
static |
|
static |
Definition at line 66 of file mapview.c.
Referenced by update_map_canvas_scrollbars(), and update_map_canvas_scrollbars_size().
|
static |
Definition at line 66 of file mapview.c.
Referenced by update_map_canvas_scrollbars(), and update_map_canvas_scrollbars_size().
|
static |
Definition at line 68 of file mapview.c.
Referenced by mapview_freeze(), mapview_is_frozen(), and mapview_thaw().