/[zanavi_public1]/navit/navit/graphics.h
ZANavi

Contents of /navit/navit/graphics.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (hide annotations) (download)
Fri Oct 28 21:19:04 2011 UTC (7 years, 11 months ago) by zoff99
File MIME type: text/plain
File size: 10851 byte(s)
import files
1 zoff99 2 /**
2     * Navit, a modular navigation system.
3     * Copyright (C) 2005-2008 Navit Team
4     *
5     * This program is free software; you can redistribute it and/or
6     * modify it under the terms of the GNU Library General Public License
7     * version 2 as published by the Free Software Foundation.
8     *
9     * This program is distributed in the hope that it will be useful,
10     * but WITHOUT ANY WARRANTY; without even the implied warranty of
11     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12     * GNU Library General Public License for more details.
13     *
14     * You should have received a copy of the GNU Library General Public
15     * License along with this program; if not, write to the
16     * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17     * Boston, MA 02110-1301, USA.
18     */
19    
20     #ifndef NAVIT_GRAPHICS_H
21     #define NAVIT_GRAPHICS_H
22    
23     #ifdef __cplusplus
24     extern "C" {
25     #endif
26     struct attr;
27     struct point;
28     struct container;
29     struct color;
30     struct graphics;
31     struct graphics_gc;
32     struct graphics_font;
33     struct graphics_image;
34     struct transformation;
35     struct display_list;
36     struct mapset;
37    
38     enum draw_mode_num {
39     draw_mode_begin, draw_mode_begin_clear, draw_mode_end, draw_mode_cursor, draw_mode_end_lazy
40     };
41    
42     struct graphics_priv;
43     struct graphics_font_priv;
44     struct graphics_image_priv;
45     struct graphics_gc_priv;
46     struct graphics_font_methods;
47     struct graphics_gc_methods;
48     struct graphics_image_methods;
49    
50     struct graphics_methods {
51     void (*graphics_destroy)(struct graphics_priv *gr);
52     void (*draw_mode)(struct graphics_priv *gr, enum draw_mode_num mode);
53     void (*draw_lines)(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count);
54     void (*draw_lines2)(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count, int order, int oneway);
55     void (*draw_lines_dashed)(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count, int order, int oneway);
56     void (*draw_polygon)(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count);
57     void (*draw_polygon2)(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count, int order, int oneway);
58     void (*draw_rectangle)(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h);
59     void (*draw_circle)(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r);
60     void (*draw_text)(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy);
61     void (*draw_image)(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img);
62     void (*draw_bigmap)(struct graphics_priv *gr, struct graphics_gc_priv *fg, int yaw, int order, float clat, float clng, int x, int y, int scx, int scy, int px, int py, int valid);
63     void (*send_osd_values)(struct graphics_priv *gr, struct graphics_gc_priv *fg, char *id, char *text1, char *text2, char *text3, int i1, int i2, int i3, int i4, float f1, float f2, float f3);
64     void (*draw_image_warp)(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, int count, char *data);
65     void (*draw_restore)(struct graphics_priv *gr, struct point *p, int w, int h);
66     void (*draw_drag)(struct graphics_priv *gr, struct point *p);
67     struct graphics_font_priv *(*font_new)(struct graphics_priv *gr, struct graphics_font_methods *meth, char *font, int size, int flags);
68     struct graphics_gc_priv *(*gc_new)(struct graphics_priv *gr, struct graphics_gc_methods *meth);
69     void (*background_gc)(struct graphics_priv *gr, struct graphics_gc_priv *gc);
70     struct graphics_priv *(*overlay_new)(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int alpha, int wraparound);
71     struct graphics_image_priv *(*image_new)(struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation);
72     void *(*get_data)(struct graphics_priv *gr, const char *type);
73     void (*image_free)(struct graphics_priv *gr, struct graphics_image_priv *priv);
74     void (*get_text_bbox)(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy, struct point *ret, int estimate);
75     void (*overlay_disable)(struct graphics_priv *gr, int disable);
76     void (*overlay_resize)(struct graphics_priv *gr, struct point *p, int w, int h, int alpha, int wraparound);
77     int (*set_attr)(struct graphics_priv *gr, struct attr *attr);
78     };
79    
80    
81     struct graphics_font_methods {
82     void (*font_destroy)(struct graphics_font_priv *font);
83     };
84    
85     struct graphics_font {
86     struct graphics_font_priv *priv;
87     struct graphics_font_methods meth;
88     };
89    
90     struct graphics_gc_methods {
91     void (*gc_destroy)(struct graphics_gc_priv *gc);
92     void (*gc_set_linewidth)(struct graphics_gc_priv *gc, int width);
93     void (*gc_set_dashes)(struct graphics_gc_priv *gc, int width, int offset, unsigned char dash_list[], int n);
94     void (*gc_set_foreground)(struct graphics_gc_priv *gc, struct color *c);
95     void (*gc_set_background)(struct graphics_gc_priv *gc, struct color *c);
96     void (*gc_set_stipple)(struct graphics_gc_priv *gc, struct graphics_image_priv *img);
97     };
98    
99     struct graphics_gc {
100     struct graphics_gc_priv *priv;
101     struct graphics_gc_methods meth;
102     struct graphics *gra;
103     };
104    
105     struct graphics_image_methods {
106     void (*image_destroy)(struct graphics_image_priv *img);
107     };
108    
109     struct graphics_image {
110     struct graphics_image_priv *priv;
111     struct graphics_image_methods meth;
112     int width;
113     int height;
114     struct point hot;
115     };
116    
117     struct graphics_data_image {
118     void *data;
119     int size;
120     };
121    
122     /* prototypes */
123     enum attr_type;
124     enum draw_mode_num;
125     enum item_type;
126     struct attr;
127     struct attr_iter;
128     struct callback;
129     struct color;
130     struct displayitem;
131     struct displaylist;
132     struct displaylist_handle;
133     struct graphics;
134     struct graphics_font;
135     struct graphics_gc;
136     struct graphics_image;
137     struct item;
138     struct itemgra;
139     struct layout;
140     struct mapset;
141     struct point;
142     struct point_rect;
143     struct transformation;
144     int graphics_set_attr(struct graphics *gra, struct attr *attr);
145     void graphics_set_rect(struct graphics *gra, struct point_rect *pr);
146     struct graphics *graphics_new(struct attr *parent, struct attr **attrs);
147     int graphics_get_attr(struct graphics *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
148     struct graphics *graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha, int wraparound);
149     void graphics_overlay_resize(struct graphics *this_, struct point *p, int w, int h, int alpha, int wraparound);
150     void graphics_init(struct graphics *this_);
151     void *graphics_get_data(struct graphics *this_, const char *type);
152     void graphics_add_callback(struct graphics *this_, struct callback *cb);
153     void graphics_remove_callback(struct graphics *this_, struct callback *cb);
154     struct graphics_font *graphics_font_new(struct graphics *gra, int size, int flags);
155     struct graphics_font *graphics_named_font_new(struct graphics *gra, char *font, int size, int flags);
156     void graphics_free(struct graphics *gra);
157     void graphics_font_destroy_all(struct graphics *gra);
158     struct graphics_gc *graphics_gc_new(struct graphics *gra);
159     void graphics_gc_destroy(struct graphics_gc *gc);
160     void graphics_gc_set_foreground(struct graphics_gc *gc, struct color *c);
161     void graphics_gc_set_background(struct graphics_gc *gc, struct color *c);
162     void graphics_gc_set_stipple(struct graphics_gc *gc, struct graphics_image *img);
163     void graphics_gc_set_linewidth(struct graphics_gc *gc, int width);
164     void graphics_gc_set_dashes(struct graphics_gc *gc, int width, int offset, unsigned char dash_list[], int n);
165     struct graphics_image *graphics_image_new_scaled(struct graphics *gra, char *path, int w, int h);
166     struct graphics_image *graphics_image_new_scaled_rotated(struct graphics *gra, char *path, int w, int h, int rotate);
167     struct graphics_image *graphics_image_new(struct graphics *gra, char *path);
168     void graphics_image_free(struct graphics *gra, struct graphics_image *img);
169     void graphics_draw_restore(struct graphics *this_, struct point *p, int w, int h);
170     void graphics_draw_mode(struct graphics *this_, enum draw_mode_num mode);
171     void graphics_draw_lines(struct graphics *this_, struct graphics_gc *gc, struct point *p, int count);
172     void graphics_draw_circle(struct graphics *this_, struct graphics_gc *gc, struct point *p, int r);
173     void graphics_draw_rectangle(struct graphics *this_, struct graphics_gc *gc, struct point *p, int w, int h);
174     void graphics_draw_rectangle_rounded(struct graphics *this_, struct graphics_gc *gc, struct point *plu, int w, int h, int r, int fill);
175     void graphics_draw_text(struct graphics *this_, struct graphics_gc *gc1, struct graphics_gc *gc2, struct graphics_font *font, char *text, struct point *p, int dx, int dy);
176     void graphics_get_text_bbox(struct graphics *this_, struct graphics_font *font, char *text, int dx, int dy, struct point *ret, int estimate);
177     void graphics_overlay_disable(struct graphics *this_, int disable);
178     void graphics_draw_image(struct graphics *this_, struct graphics_gc *gc, struct point *p, struct graphics_image *img);
179     int graphics_draw_drag(struct graphics *this_, struct point *p);
180     void graphics_background_gc(struct graphics *this_, struct graphics_gc *gc);
181     void graphics_draw_text_std(struct graphics *this_, int text_size, char *text, struct point *p);
182     char *graphics_icon_path(char *icon);
183     void graphics_draw_itemgra(struct graphics *gra, struct itemgra *itm, struct transformation *t, char *label);
184     void graphics_displaylist_draw(struct graphics *gra, struct displaylist *displaylist, struct transformation *trans, struct layout *l, int flags);
185     void graphics_draw(struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb, int flags);
186     int graphics_draw_cancel(struct graphics *gra, struct displaylist *displaylist);
187     struct displaylist_handle *graphics_displaylist_open(struct displaylist *displaylist);
188     struct displayitem *graphics_displaylist_next(struct displaylist_handle *dlh);
189     void graphics_displaylist_close(struct displaylist_handle *dlh);
190     struct displaylist *graphics_displaylist_new(void);
191     struct item *graphics_displayitem_get_item(struct displayitem *di);
192     int graphics_displayitem_get_coord_count(struct displayitem *di);
193     char *graphics_displayitem_get_label(struct displayitem *di);
194     int graphics_displayitem_get_displayed(struct displayitem *di);
195     int graphics_displayitem_within_dist(struct displaylist *displaylist, struct displayitem *di, struct point *p, int dist);
196     void graphics_add_selection(struct graphics *gra, struct item *item, enum item_type type, struct displaylist *dl);
197     void graphics_remove_selection(struct graphics *gra, struct item *item, enum item_type type, struct displaylist *dl);
198     void graphics_clear_selection(struct graphics *gra, struct displaylist *dl);
199     /* end of prototypes */
200     #ifdef __cplusplus
201     }
202     #endif
203    
204     #endif
205    

   
Visit the ZANavi Wiki