Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/include/canvas_g.h Source File

Freeciv-3.2

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_full_scaled, struct canvas *pcanvas,
49 int canvas_x, int canvas_y, int canvas_w, int canvas_h,
50 struct sprite *sprite)
51 GUI_FUNC_PROTO(void, canvas_put_sprite_fogged, struct canvas *pcanvas,
52 int canvas_x, int canvas_y,
53 struct sprite *psprite,
54 bool fog, int fog_x, int fog_y)
55 GUI_FUNC_PROTO(void, canvas_put_rectangle, struct canvas *pcanvas,
56 struct color *pcolor,
57 int canvas_x, int canvas_y, int width, int height)
58 GUI_FUNC_PROTO(void, canvas_fill_sprite_area, struct canvas *pcanvas,
59 struct sprite *psprite,
60 struct color *pcolor,
61 int canvas_x, int canvas_y)
62 GUI_FUNC_PROTO(void, canvas_put_line, struct canvas *pcanvas,
63 struct color *pcolor,
64 enum line_type ltype, int start_x, int start_y,
65 int dx, int dy)
66 GUI_FUNC_PROTO(void, canvas_put_curved_line, struct canvas *pcanvas,
67 struct color *pcolor,
68 enum line_type ltype, int start_x, int start_y,
69 int dx, int dy)
70
71/* Text drawing functions */
72 enum client_font {
73 FONT_CITY_NAME,
74 FONT_CITY_PROD,
75 FONT_REQTREE_TEXT,
76 FONT_COUNT
77};
78 GUI_FUNC_PROTO(void, get_text_size, int *width, int *height,
79 enum client_font font, const char *text)
80 GUI_FUNC_PROTO(void, canvas_put_text, struct canvas *pcanvas,
81 int canvas_x, int canvas_y, enum client_font font,
82 struct color *pcolor, const char *text)
83
84#endif /* FC__CANVAS_G_H */
height
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
pcolor
struct canvas int int int int struct sprite *sprite struct canvas struct color * pcolor
Definition canvas_g.h:56
canvas_put_rectangle
struct canvas int int int int struct sprite *sprite canvas_put_rectangle
Definition canvas_g.h:55
canvas_y
struct canvas int int canvas_y
Definition canvas_g.h:43
canvas_x
struct canvas int canvas_x
Definition canvas_g.h:43
canvas_put_line
struct canvas int int int int struct sprite *sprite struct canvas struct color int int int int height canvas_put_line
Definition canvas_g.h:62
canvas_put_sprite
canvas_put_sprite
Definition canvas_g.h:42
canvas_w
struct canvas int int int canvas_w
Definition canvas_g.h:49
canvas_h
struct canvas int int int int canvas_h
Definition canvas_g.h:49
pcanvas
struct canvas * pcanvas
Definition canvas_g.h:42
canvas_put_sprite_full_scaled
canvas_put_sprite_full_scaled
Definition canvas_g.h:48
canvas_put_text
canvas_put_text
Definition canvas_g.h:80
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
width
struct canvas int int struct sprite int int int width
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
incite_cost
char * incite_cost
Definition comments.c:74
canvas_put_sprite_full
void canvas_put_sprite_full(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite)
Definition canvas.c:144
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
canvas_fill_sprite_area
void canvas_fill_sprite_area(struct canvas *pcanvas, struct sprite *psprite, struct color *pcolor, int canvas_x, int canvas_y)
Definition canvas.c:211
get_text_size
void get_text_size(int *width, int *height, enum client_font font, const char *text)
Definition canvas.c:341
canvas_free
void canvas_free(struct canvas *store)
Definition canvas.c:44
canvas_put_curved_line
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)
Definition canvas.c:276
has_zoom_support
bool has_zoom_support(void)
Definition canvas.c:61
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
canvas_put_sprite_fogged
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)
Definition canvas.c:170
gui_proto_constructor.h
GUI_FUNC_PROTO
#define GUI_FUNC_PROTO(_type, _func,...)
Definition gui_proto_constructor.h:22
canvas
Definition canvas.h:22
canvas::zoom
float zoom
Definition canvas.h:25
color
Definition colors.h:21
sprite
Definition sprite.h:22
support.h