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

Freeciv-3.2

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
42void get_reqtree_dimensions(struct reqtree *tree,
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
50 Tech_type_id get_tech_on_reqtree(struct reqtree *tree, int x, int y);
51bool find_tech_on_reqtree(struct reqtree *tree, Tech_type_id tech,
52 int *x, int *y, int *w, int *h);
53
54#ifdef __cplusplus
55}
56#endif /* __cplusplus */
57
58#endif /* FC__REQTREE_H */
canvas_g.h
height
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
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
pcanvas
struct canvas * pcanvas
Definition canvas_g.h:42
width
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
incite_cost
char * incite_cost
Definition comments.c:74
Tech_type_id
int Tech_type_id
Definition fc_types.h:380
draw_reqtree
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:1036
get_reqtree_dimensions
void get_reqtree_dimensions(struct reqtree *tree, int *width, int *height)
Definition reqtree.c:870
get_tech_on_reqtree
Tech_type_id get_tech_on_reqtree(struct reqtree *tree, int x, int y)
Definition reqtree.c:1176
find_tech_on_reqtree
bool find_tech_on_reqtree(struct reqtree *tree, Tech_type_id tech, int *x, int *y, int *w, int *h)
Definition reqtree.c:1199
destroy_reqtree
void destroy_reqtree(struct reqtree *tree)
Definition reqtree.c:473
create_reqtree
struct reqtree * create_reqtree(struct player *pplayer, bool show_all)
Definition reqtree.c:839
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
canvas
Definition canvas.h:22
player
Definition player.h:247
reqtree
Definition repodlgs.cpp:85