webperimental: killstack decides stack protects.
[freeciv.git] / client / gui-stub / canvas.c
blob14f76fbb10c38d790b88f33b740b15eff3466b05
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.
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 ***********************************************************************/
14 #ifdef HAVE_CONFIG_H
15 #include <fc_config.h>
16 #endif
18 /* gui main header */
19 #include "gui_stub.h"
21 #include "canvas.h"
23 /****************************************************************************
24 Create a canvas of the given size.
25 ****************************************************************************/
26 struct canvas *gui_canvas_create(int width, int height)
28 /* PORTME */
29 return NULL;
32 /****************************************************************************
33 Free any resources associated with this canvas and the canvas struct
34 itself.
35 ****************************************************************************/
36 void gui_canvas_free(struct canvas *store)
38 /* PORTME */
41 /****************************************************************************
42 Set canvas zoom for future drawing operations.
43 ****************************************************************************/
44 void gui_canvas_set_zoom(struct canvas *store, float zoom)
46 /* PORTME */
49 /****************************************************************************
50 This gui has zoom support.
51 ****************************************************************************/
52 bool gui_has_zoom_support(void)
54 return FALSE;
57 /****************************************************************************
58 Copies an area from the source canvas to the destination canvas.
59 ****************************************************************************/
60 void gui_canvas_copy(struct canvas *dest, struct canvas *src,
61 int src_x, int src_y, int dest_x, int dest_y, int width,
62 int height)
64 /* PORTME */
67 /****************************************************************************
68 Draw some or all of a sprite onto the canvas.
69 ****************************************************************************/
70 void gui_canvas_put_sprite(struct canvas *pcanvas,
71 int canvas_x, int canvas_y,
72 struct sprite *sprite,
73 int offset_x, int offset_y, int width, int height)
75 /* PORTME */
78 /****************************************************************************
79 Draw a full sprite onto the canvas.
80 ****************************************************************************/
81 void gui_canvas_put_sprite_full(struct canvas *pcanvas,
82 int canvas_x, int canvas_y,
83 struct sprite *sprite)
85 /* PORTME */
88 /****************************************************************************
89 Draw a full sprite onto the canvas. If "fog" is specified draw it with
90 fog.
91 ****************************************************************************/
92 void gui_canvas_put_sprite_fogged(struct canvas *pcanvas,
93 int canvas_x, int canvas_y,
94 struct sprite *psprite,
95 bool fog, int fog_x, int fog_y)
97 /* PORTME */
100 /****************************************************************************
101 Draw a filled-in colored rectangle onto canvas.
102 ****************************************************************************/
103 void gui_canvas_put_rectangle(struct canvas *pcanvas,
104 struct color *pcolor,
105 int canvas_x, int canvas_y, int width, int height)
107 /* PORTME */
110 /****************************************************************************
111 Fill the area covered by the sprite with the given color.
112 ****************************************************************************/
113 void gui_canvas_fill_sprite_area(struct canvas *pcanvas,
114 struct sprite *psprite, struct color *pcolor,
115 int canvas_x, int canvas_y)
117 /* PORTME */
120 /****************************************************************************
121 Draw a 1-pixel-width colored line onto the canvas.
122 ****************************************************************************/
123 void gui_canvas_put_line(struct canvas *pcanvas, struct color *pcolor,
124 enum line_type ltype, int start_x, int start_y,
125 int dx, int dy)
127 /* PORTME */
130 /****************************************************************************
131 Draw a 1-pixel-width colored curved line onto the canvas.
132 ****************************************************************************/
133 void gui_canvas_put_curved_line(struct canvas *pcanvas, struct color *pcolor,
134 enum line_type ltype, int start_x, int start_y,
135 int dx, int dy)
137 /* PORTME */
140 /****************************************************************************
141 Return the size of the given text in the given font. This size should
142 include the ascent and descent of the text. Either of width or height
143 may be NULL in which case those values simply shouldn't be filled out.
144 ****************************************************************************/
145 void gui_get_text_size(int *width, int *height,
146 enum client_font font, const char *text)
148 /* PORTME */
149 if (width) {
150 *width = 0;
152 if (height) {
153 *height = 0;
157 /****************************************************************************
158 Draw the text onto the canvas in the given color and font. The canvas
159 position does not account for the ascent of the text; this function must
160 take care of this manually. The text will not be NULL but may be empty.
161 ****************************************************************************/
162 void gui_canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
163 enum client_font font, struct color *pcolor,
164 const char *text)
166 /* PORTME */