Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/include/canvas_g.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
canvas_g.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__CANVAS_G_H
14#define FC__CANVAS_G_H
15
16#include "support.h" /* bool type */
17
18#include "gui_proto_constructor.h"
19
20struct color;
21struct sprite;
22
23struct canvas; /* Opaque type, real type is gui-dep */
24
25 enum line_type {
26 LINE_NORMAL, LINE_BORDER, LINE_TILE_FRAME, LINE_GOTO, LINE_SELECT_RECT
27};
28
29/* Creator and destructor */
30 GUI_FUNC_PROTO(struct canvas *, canvas_create, int width, int height)
31 GUI_FUNC_PROTO(void, canvas_free, struct canvas *store)
32
33 GUI_FUNC_PROTO(void, canvas_set_zoom, struct canvas *store, float zoom)
34 GUI_FUNC_PROTO(bool, has_zoom_support, void)
35
36 GUI_FUNC_PROTO(void, canvas_mapview_init, struct canvas *store);
37
38/* Drawing functions */
39 GUI_FUNC_PROTO(void, canvas_copy, struct canvas *dest, struct canvas *src,
40 int src_x, int src_y, int dest_x, int dest_y,
41 int width, int height)
42 GUI_FUNC_PROTO(void, canvas_put_sprite, struct canvas *pcanvas,
43 int canvas_x, int canvas_y, struct sprite *sprite,
44 int offset_x, int offset_y, int width, int height);
45 GUI_FUNC_PROTO(void, canvas_put_sprite_full, struct canvas *pcanvas,
46 int canvas_x, int canvas_y,
47 struct sprite *sprite)
48 GUI_FUNC_PROTO(void, canvas_put_sprite_fogged, struct canvas *pcanvas,
49 int canvas_x, int canvas_y,
50 struct sprite *psprite,
51 bool fog, int fog_x, int fog_y)
52 GUI_FUNC_PROTO(void, canvas_put_rectangle, struct canvas *pcanvas,
53 struct color *pcolor,
54 int canvas_x, int canvas_y, int width, int height)
55 GUI_FUNC_PROTO(void, canvas_fill_sprite_area, struct canvas *pcanvas,
56 struct sprite *psprite,
57 struct color *pcolor,
58 int canvas_x, int canvas_y)
59 GUI_FUNC_PROTO(void, canvas_put_line, struct canvas *pcanvas,
60 struct color *pcolor,
61 enum line_type ltype, int start_x, int start_y,
62 int dx, int dy)
63 GUI_FUNC_PROTO(void, canvas_put_curved_line, struct canvas *pcanvas,
64 struct color *pcolor,
65 enum line_type ltype, int start_x, int start_y,
66 int dx, int dy)
67
68/* Text drawing functions */
69enum client_font {
70 FONT_CITY_NAME,
71 FONT_CITY_PROD,
72 FONT_REQTREE_TEXT,
73 FONT_COUNT
74};
75 GUI_FUNC_PROTO(void, get_text_size, int *width, int *height,
76 enum client_font font, const char *text)
77 GUI_FUNC_PROTO(void, canvas_put_text, struct canvas *pcanvas,
78 int canvas_x, int canvas_y, enum client_font font,
79 struct color *pcolor, const char *text)
80
81#endif /* FC__CANVAS_G_H */
canvas_fill_sprite_area
struct canvas int int struct sprite bool int int fog_y canvas_fill_sprite_area
Definition canvas_g.h:55
height
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
pcolor
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color * pcolor
Definition canvas_g.h:57
fog_x
struct canvas int int struct sprite bool int fog_x
Definition canvas_g.h:51
FONT_REQTREE_TEXT
FONT_REQTREE_TEXT
Definition canvas_g.h:72
canvas_y
struct canvas int int canvas_y
Definition canvas_g.h:43
canvas_put_sprite_fogged
canvas_put_sprite_fogged
Definition canvas_g.h:48
canvas_x
struct canvas int canvas_x
Definition canvas_g.h:43
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 canvas_put_curved_line
Definition canvas_g.h:63
FONT_CITY_NAME
FONT_CITY_NAME
Definition canvas_g.h:70
canvas_put_sprite
canvas_put_sprite
Definition canvas_g.h:42
FONT_CITY_PROD
FONT_CITY_PROD
Definition canvas_g.h:71
client_font
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
Definition canvas_g.h:69
width
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
pcanvas
struct canvas * pcanvas
Definition canvas_g.h:42
psprite
struct canvas int int struct sprite * psprite
Definition canvas_g.h:50
canvas_put_text
canvas_put_text
Definition canvas_g.h:77
offset_y
struct canvas int int struct sprite int int offset_y
Definition canvas_g.h:44
offset_x
struct canvas int int struct sprite int offset_x
Definition canvas_g.h:44
line_type
line_type
Definition canvas_g.h:25
LINE_SELECT_RECT
@ LINE_SELECT_RECT
Definition canvas_g.h:26
LINE_GOTO
@ LINE_GOTO
Definition canvas_g.h:26
LINE_TILE_FRAME
@ LINE_TILE_FRAME
Definition canvas_g.h:26
LINE_BORDER
@ LINE_BORDER
Definition canvas_g.h:26
LINE_NORMAL
@ LINE_NORMAL
Definition canvas_g.h:26
fog
struct canvas int int struct sprite bool fog
Definition canvas_g.h:51
canvas_put_rectangle
void canvas_put_rectangle(struct canvas *pcanvas, struct color *pcolor, int canvas_x, int canvas_y, int width, int height)
Definition canvas.c:176
canvas_put_sprite_full
void canvas_put_sprite_full(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite)
Definition canvas.c:148
canvas_set_zoom
void canvas_set_zoom(struct canvas *store, float zoom)
Definition canvas.c:53
canvas_mapview_init
void canvas_mapview_init(struct canvas *store)
Definition canvas.c:69
get_text_size
void get_text_size(int *width, int *height, enum client_font font, const char *text)
Definition canvas.c:347
canvas_free
void canvas_free(struct canvas *store)
Definition canvas.c:44
has_zoom_support
bool has_zoom_support(void)
Definition canvas.c:61
canvas_put_line
void canvas_put_line(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
Definition canvas.c:223
canvas_copy
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)
Definition canvas.c:76
canvas_create
struct canvas * canvas_create(int width, int height)
Definition canvas.c:28
gui_proto_constructor.h
GUI_FUNC_PROTO
#define GUI_FUNC_PROTO(_type, _func,...)
Definition gui_proto_constructor.h:22
canvas
Definition canvas.h:21
canvas::zoom
float zoom
Definition canvas.h:24
color
Definition colors.h:20
sprite
Definition sprite.h:22
support.h