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)
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
16 #include "support.h" /* bool type */
18 #include "gui_proto_constructor.h"
23 struct canvas
; /* opaque type, real type is gui-dep */
26 LINE_NORMAL
, LINE_BORDER
, LINE_TILE_FRAME
, LINE_GOTO
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
)
33 GUI_FUNC_PROTO(void, canvas_set_zoom
, struct canvas
*store
, float zoom
)
34 GUI_FUNC_PROTO(bool, has_zoom_support
, void)
36 /* Drawing functions */
37 GUI_FUNC_PROTO(void, canvas_copy
, struct canvas
*dest
, struct canvas
*src
,
38 int src_x
, int src_y
, int dest_x
, int dest_y
,
39 int width
, int height
)
40 GUI_FUNC_PROTO(void, canvas_put_sprite
, struct canvas
*pcanvas
,
41 int canvas_x
, int canvas_y
, struct sprite
*sprite
,
42 int offset_x
, int offset_y
, int width
, int height
);
43 GUI_FUNC_PROTO(void, canvas_put_sprite_full
, struct canvas
*pcanvas
,
44 int canvas_x
, int canvas_y
,
45 struct sprite
*sprite
)
46 GUI_FUNC_PROTO(void, canvas_put_sprite_fogged
, struct canvas
*pcanvas
,
47 int canvas_x
, int canvas_y
,
48 struct sprite
*psprite
,
49 bool fog
, int fog_x
, int fog_y
)
50 GUI_FUNC_PROTO(void, canvas_put_rectangle
, struct canvas
*pcanvas
,
52 int canvas_x
, int canvas_y
, int width
, int height
)
53 GUI_FUNC_PROTO(void, canvas_fill_sprite_area
, struct canvas
*pcanvas
,
54 struct sprite
*psprite
,
56 int canvas_x
, int canvas_y
)
57 GUI_FUNC_PROTO(void, canvas_put_line
, struct canvas
*pcanvas
,
59 enum line_type ltype
, int start_x
, int start_y
,
61 GUI_FUNC_PROTO(void, canvas_put_curved_line
, struct canvas
*pcanvas
,
63 enum line_type ltype
, int start_x
, int start_y
,
66 /* Text drawing functions */
73 GUI_FUNC_PROTO(void, get_text_size
, int *width
, int *height
,
74 enum client_font font
, const char *text
)
75 GUI_FUNC_PROTO(void, canvas_put_text
, struct canvas
*pcanvas
,
76 int canvas_x
, int canvas_y
, enum client_font font
,
77 struct color
*pcolor
, const char *text
)
79 #endif /* FC__CANVAS_G_H */