32 result->
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
46 cairo_surface_destroy(store->
surface);
77 int src_x,
int src_y,
int dest_x,
int dest_y,
83 cr = cairo_create(dest->
surface);
93 cairo_set_source_surface(cr, src->
surface, dest_x - src_x, dest_y - src_y);
94 cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
114 int sswidth, ssheight;
131 cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
193 gdk_cairo_set_source_rgba(cr, &
pcolor->color);
194 cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
225 enum line_type ltype,
int start_x,
int start_y,
229 double dashes[2] = {4.0, 4.0};
243 cairo_set_line_width(cr, 1.);
247 cairo_set_dash(cr, dashes, 2, 0);
250 cairo_set_line_width(cr, 2.);
253 cairo_set_line_width(cr, 2.);
256 cairo_set_line_width(cr, 2.);
257 cairo_set_dash(cr, dashes, 2, 0);
258 cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
262 gdk_cairo_set_source_rgba(cr, &
pcolor->color);
263 cairo_move_to(cr, start_x, start_y);
264 cairo_line_to(cr, start_x + dx, start_y + dy);
280 enum line_type ltype,
int start_x,
int start_y,
283 int end_x = start_x + dx;
284 int end_y = start_y + dy;
286 double dashes[2] = {4.0, 4.0};
300 cairo_set_line_width(cr, 1.);
303 cairo_set_dash(cr, dashes, 2, 0);
307 cairo_set_line_width(cr, 2.);
310 cairo_set_line_width(cr, 2.);
313 cairo_set_line_width(cr, 2.);
314 cairo_set_dash(cr, dashes, 2, 0);
315 cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
319 gdk_cairo_set_source_rgba(cr, &
pcolor->color);
320 cairo_move_to(cr, start_x, start_y);
321 cairo_curve_to(cr, end_x, start_y, start_x, end_y, end_x, end_y);
335}
fonts[FONT_COUNT] = {
340#define FONT(font) (*fonts[font].styles)
353 layout = pango_layout_new(gdk_pango_context_get_for_screen(gdk_screen_get_default()));
356 pango_layout_set_font_description(
layout,
FONT(font));
357 pango_layout_set_text(
layout, text, -1);
359 pango_layout_get_pixel_extents(
layout, NULL, &rect);
410 layout = pango_layout_new(gdk_pango_context_get_for_screen(gdk_screen_get_default()));
413 pango_layout_set_font_description(
layout,
FONT(font));
414 pango_layout_set_text(
layout, text, -1);
418 const GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
420 if (!gdk_rgba_equal(&
pcolor->color, &black)) {
421 gdk_cairo_set_source_rgba(cr, &black);
422 cairo_move_to(cr, x * zoom + 1,
424 pango_cairo_show_layout(cr,
layout);
428 cairo_move_to(cr, x * zoom, y * zoom);
429 gdk_cairo_set_source_rgba(cr, &
pcolor->color);
430 pango_cairo_show_layout(cr,
layout);
struct canvas int int struct sprite bool int int fog_y canvas_fill_sprite_area
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color * pcolor
struct canvas int int struct sprite bool int fog_x
struct canvas int int canvas_y
struct canvas int canvas_x
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color int int canvas_y canvas_put_curved_line
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color int int canvas_y struct canvas struct color enum line_type ltype int start_x int start_y int dx int dy enum client_font
struct canvas int int struct sprite int int int width
struct canvas int int struct sprite * psprite
struct canvas int int struct sprite int int offset_y
struct canvas int int struct sprite int offset_x
struct canvas int int struct sprite bool fog
void canvas_put_rectangle(struct canvas *pcanvas, struct color *pcolor, int canvas_x, int canvas_y, int width, int height)
void canvas_put_sprite_full(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite)
void canvas_set_zoom(struct canvas *store, float zoom)
void canvas_mapview_init(struct canvas *store)
void get_text_size(int *width, int *height, enum client_font font, const char *text)
void canvas_free(struct canvas *store)
bool has_zoom_support(void)
void canvas_put_line(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
static PangoLayout * layout
void surface_put_text(cairo_t *cr, int x, int y, float zoom, enum client_font font, struct color *pcolor, const char *text)
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)
struct canvas * canvas_create(int width, int height)
PangoFontDescription * city_productions_style
PangoFontDescription * city_names_style
PangoFontDescription * reqtree_text_style
void pixmap_put_overlay_tile_draw(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *ssprite, bool fog)
void get_sprite_dimensions(struct sprite *sprite, int *width, int *height)
cairo_surface_t * surface
cairo_surface_t * surface
static struct nation_style * styles