Stop sharing requirement_unit_state_ereq().
[freeciv.git] / client / reqtree.h
blob7574781d1ddf3d63c0331346202a5ee09c909182
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.
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 #ifndef FC__REQTREE_H
15 #define FC__REQTREE_H
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 #include "canvas_g.h"
23 /* Requirements Tree
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.
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.
34 * Currently only techs are supported (as sources and requirements).
37 struct reqtree;
39 struct reqtree *create_reqtree(struct player *pplayer, bool show_all);
40 void destroy_reqtree(struct reqtree *tree);
42 void get_reqtree_dimensions(struct reqtree *tree,
43 int *width, int *height);
45 void 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);
50 Tech_type_id get_tech_on_reqtree(struct reqtree *tree, int x, int y);
51 bool find_tech_on_reqtree(struct reqtree *tree, Tech_type_id tech,
52 int *x, int *y, int *w, int *h);
54 #ifdef __cplusplus
56 #endif /* __cplusplus */
58 #endif /* FC__REQTREE_H */