Freeciv-3.1
|
Go to the source code of this file.
Macros | |
#define | FONT(font) (*fonts[font].styles) |
Functions | |
struct canvas * | canvas_create (int width, int height) |
void | canvas_free (struct canvas *store) |
void | canvas_set_zoom (struct canvas *store, float zoom) |
bool | has_zoom_support (void) |
void | canvas_mapview_init (struct canvas *store) |
void | canvas_copy (struct canvas *dest, struct canvas *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height) |
void | canvas_put_sprite (struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite, int offset_x, int offset_y, int width, int height) |
void | canvas_put_sprite_full (struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite) |
void | canvas_put_sprite_fogged (struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *psprite, bool fog, int fog_x, int fog_y) |
void | canvas_put_rectangle (struct canvas *pcanvas, struct color *pcolor, int canvas_x, int canvas_y, int width, int height) |
void | canvas_fill_sprite_area (struct canvas *pcanvas, struct sprite *psprite, struct color *pcolor, int canvas_x, int canvas_y) |
void | canvas_put_line (struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy) |
void | canvas_put_curved_line (struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy) |
void | get_text_size (int *width, int *height, enum client_font font, const char *text) |
void | canvas_put_text (struct canvas *pcanvas, int canvas_x, int canvas_y, enum client_font font, struct color *pcolor, const char *text) |
void | surface_put_text (cairo_t *cr, int x, int y, float zoom, enum client_font font, struct color *pcolor, const char *text) |
Variables | ||
static PangoLayout * | layout | |
struct { | ||
PangoFontDescription ** styles | ||
bool shadowed | ||
} | fonts [FONT_COUNT] | |
void canvas_copy | ( | struct canvas * | dest, |
struct canvas * | src, | ||
int | src_x, | ||
int | src_y, | ||
int | dest_x, | ||
int | dest_y, | ||
int | width, | ||
int | height | ||
) |
Copies an area from the source canvas to the destination canvas.
Definition at line 76 of file canvas.c.
Referenced by base_set_mapview_origin(), decrease_unit_hp_smooth(), move_unit_map_canvas(), redraw_overview(), refresh_overview_from_canvas(), and update_map_canvas().
struct canvas * canvas_create | ( | int | width, |
int | height | ||
) |
Create a canvas of the given size.
Definition at line 28 of file canvas.c.
Referenced by calculate_overview_dimensions(), create_city_map(), create_unit_surface(), get_terrain_surface(), map_canvas_resized(), overview_size_changed(), and redraw_unit_info_label().
void canvas_free | ( | struct canvas * | store | ) |
Free any resources associated with this canvas and the canvas struct itself.
Definition at line 44 of file canvas.c.
Referenced by calculate_overview_dimensions(), city_map_canvas_free(), create_unit_surface(), impr_item::enterEvent(), free_mapcanvas_and_overview(), get_terrain_surface(), impr_item::leaveEvent(), map_canvas_resized(), overview_free(), overview_size_changed(), redraw_unit_info_label(), research_diagram::reset(), unit_item::unit_item(), impr_item::~impr_item(), and research_diagram::~research_diagram().
void canvas_mapview_init | ( | struct canvas * | store | ) |
Initialize canvas as mapview.
Definition at line 69 of file canvas.c.
Referenced by map_canvas_resized().
void canvas_put_line | ( | struct canvas * | pcanvas, |
struct color * | pcolor, | ||
enum line_type | ltype, | ||
int | start_x, | ||
int | start_y, | ||
int | dx, | ||
int | dy | ||
) |
Draw a colored line onto the mapview or citydialog canvas. XXX: unlike other canvas_put functions, supplied x/y are not prior to any canvas zoom.
Definition at line 223 of file canvas.c.
Referenced by canvas_put_curved_line(), draw_reqtree(), draw_segment(), draw_selection_rectangle(), draw_trade_route_line(), link_mark_draw(), redraw_overview(), and show_full_citybar().
void canvas_put_rectangle | ( | struct canvas * | pcanvas, |
struct color * | pcolor, | ||
int | canvas_x, | ||
int | canvas_y, | ||
int | width, | ||
int | height | ||
) |
Draw a filled-in colored rectangle onto the mapview or citydialog canvas. Supplied coordinates are prior to any canvas zoom.
Definition at line 176 of file canvas.c.
Referenced by calculate_overview_dimensions(), canvas_fill_sprite_area(), city_dialog_redraw_map(), draw_reqtree(), map_canvas_resized(), put_overview_tile_area(), put_spaceship(), show_full_citybar(), and update_map_canvas().
void canvas_put_sprite_full | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
struct sprite * | sprite | ||
) |
Draw a full sprite onto the mapview or citydialog canvas. Supplied canvas_x/y are prior to any canvas zoom.
Definition at line 148 of file canvas.c.
Referenced by canvas_put_sprite_fogged(), decrease_unit_hp_smooth(), draw_reqtree(), explosion_animation(), nuke_animation(), put_drawn_sprites(), put_nuke_mushroom_pixmaps(), put_spaceship(), put_unit_city_overlays(), and show_full_citybar().
void canvas_put_text | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
enum client_font | font, | ||
struct color * | pcolor, | ||
const char * | text | ||
) |
Draw the text onto the canvas in the given color and font. The canvas position does not account for the ascent of the text; this function must take care of this manually. The text will not be NULL but may be empty. Supplied canvas_x/y are prior to any canvas zoom.
void canvas_set_zoom | ( | struct canvas * | store, |
float | zoom | ||
) |
Set canvas zoom for future drawing operations.
Definition at line 53 of file canvas.c.
Referenced by map_canvas_resized().
void get_text_size | ( | int * | width, |
int * | height, | ||
enum client_font | font, | ||
const char * | text | ||
) |
Return the size of the given text in the given font. This size should include the ascent and descent of the text. Either of width or height may be NULL in which case those values simply shouldn't be filled out.
Definition at line 347 of file canvas.c.
Referenced by research_diagram::create_tooltip_help(), draw_reqtree(), load_gfxnumber(), node_rectangle_minimum_size(), show_full_citybar(), show_small_citybar(), and show_tile_label().
bool has_zoom_support | ( | void | ) |
This gui has zoom support.
Definition at line 61 of file canvas.c.
Referenced by set_client_page_callback().
void surface_put_text | ( | cairo_t * | cr, |
int | x, | ||
int | y, | ||
float | zoom, | ||
enum client_font | font, | ||
struct color * | pcolor, | ||
const char * | text | ||
) |
Draw the text onto the surface in the given color and font. The position does not account for the ascent of the text; this function must take care of this manually. The text may not be NULL but may be empty.
Definition at line 405 of file canvas.c.
Referenced by canvas_put_text(), and load_gfxnumber().
struct { ... } fonts[FONT_COUNT] |
|
static |
Definition at line 331 of file canvas.c.
Referenced by hud_battle_log::add_combat_info(), help_widget::add_info_progress(), create_cma_dialog(), help_widget::create_terrain_widget(), help_widget::do_layout(), get_text_size(), help_dialog::help_dialog(), pregame_options::init(), intro_expose(), intro_expose(), fc_shortcuts_dialog::refresh(), hud_message_box::set_text_title(), hud_input_box::set_text_title_definput(), help_widget::setup_ui(), ss_report::ss_report(), surface_put_text(), mr_menu::tileset_custom_load(), and hud_battle_log::update_size().
bool shadowed |
Definition at line 334 of file canvas.c.
Referenced by surface_put_text().