Freeciv-3.3
Loading...
Searching...
No Matches
reqtree.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2005-2007 - The Freeciv Project
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
14#ifndef FC__REQTREE_H
15#define FC__REQTREE_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21#include "canvas_g.h"
22
23/* Requirements Tree
24 *
25 * This file provides functions for drawing a tree-like graph of
26 * requirements. This can be used for creating an interactive diagram
27 * showing the dependencies of various sources.
28 *
29 * A tree must first be created with create_reqtree; this will do all of the
30 * calculations needed for the tree and is a fairly expensive operation.
31 * After creating the tree, the other functions may be used to access or
32 * draw it.
33 *
34 * Currently only techs are supported (as sources and requirements).
35 */
36
37struct reqtree;
38
39struct reqtree *create_reqtree(struct player *pplayer, bool show_all);
40void destroy_reqtree(struct reqtree *tree);
41
43 int *width, int *height);
44
45void draw_reqtree(struct reqtree *tree,
46 struct canvas *pcanvas,
47 int canvas_x, int canvas_y,
48 int tt_x, int tt_y, int w, int h);
49
52 int *x, int *y, int *w, int *h);
53
54#ifdef __cplusplus
55}
56#endif /* __cplusplus */
57
58#endif /* FC__REQTREE_H */
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
struct canvas int int canvas_y
Definition canvas_g.h:43
struct canvas int canvas_x
Definition canvas_g.h:43
struct canvas * pcanvas
Definition canvas_g.h:42
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
char * incite_cost
Definition comments.c:76
int Tech_type_id
Definition fc_types.h:236
void draw_reqtree(struct reqtree *tree, struct canvas *pcanvas, int canvas_x, int canvas_y, int tt_x, int tt_y, int w, int h)
Definition reqtree.c:1045
void get_reqtree_dimensions(struct reqtree *tree, int *width, int *height)
Definition reqtree.c:878
Tech_type_id get_tech_on_reqtree(struct reqtree *tree, int x, int y)
Definition reqtree.c:1185
bool find_tech_on_reqtree(struct reqtree *tree, Tech_type_id tech, int *x, int *y, int *w, int *h)
Definition reqtree.c:1209
void destroy_reqtree(struct reqtree *tree)
Definition reqtree.c:478
struct reqtree * create_reqtree(struct player *pplayer, bool show_all)
Definition reqtree.c:847
struct sprite int int y
Definition sprite_g.h:31
struct sprite int x
Definition sprite_g.h:31