navit  0.5.3-trunk
osd.h
Go to the documentation of this file.
1 
20 #ifndef NAVIT_OSD_H
21 #define NAVIT_OSD_H
22 
23 struct osd_priv;
24 struct attr;
25 
26 #define TRANSPARENT_BG 1
27 #define ITEM_HAS_TEXT 2
28 #define DISABLE_OVERLAY 4
29 
30 struct osd_methods {
31  void (*osd_destroy)(struct osd_priv *osd);
32  int (*set_attr)(struct osd_priv *osd, struct attr* attr);
33  void (*destroy)(struct osd_priv *osd);
34  int (*get_attr)(struct osd_priv *osd, enum attr_type type, struct attr* attr);
35 };
36 
37 #define osd_draw_cast(x) (void (*)(struct osd_priv *osd, struct navit *navit, struct vehicle *v))(x)
38 
40  void (*draw)(struct osd_priv *osd, struct navit *navit, struct vehicle *v);
41 };
42 
43 struct osd_item {
44  struct point p;
45  struct osd_item_methods meth;
48  struct color color_bg, color_fg, text_color;
49  struct navit *navit;
50  struct graphics *gr;
53  char *font_name;
54  struct callback *cb;
58  int pressed;
59  char *command;
61  char *accesskey;
62  int do_draw;
63 };
64 
65 /* prototypes */
66 struct attr;
67 struct navit;
68 struct osd;
69 struct osd *osd_new(struct attr *parent, struct attr **attrs);
70 int osd_set_methods(struct osd_methods *in, int in_size, struct osd_methods *out);
71 void osd_wrap_point(struct point *p, struct navit *nav);
72 void osd_std_click(struct osd_item *this, struct navit *nav, int pressed, int button, struct point *p);
73 void osd_set_std_attr(struct attr **attrs, struct osd_item *item, int flags);
74 void osd_std_config(struct osd_item *item, struct navit *navit);
75 void osd_set_keypress(struct navit *nav, struct osd_item *item);
76 void osd_set_std_config(struct navit *nav, struct osd_item *item);
77 void osd_set_std_graphic(struct navit *nav, struct osd_item *item, struct osd_priv *priv);
78 void osd_std_resize(struct osd_item *item);
79 void osd_std_calculate_sizes(struct osd_item *item, int w, int h);
80 void osd_fill_with_bgcolor(struct osd_item *item);
81 int osd_set_attr(struct osd *osd, struct attr* attr);
82 int osd_get_attr(struct osd *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
83 /* end of prototypes */
84 
85 #endif
86 
attr_type
Definition: attr.h:34
char type[3]
Definition: garmin_img.c:2
flags
Definition: gui_internal.h:26
unsigned char p[5]
Definition: mg.h:2
navit
Definition: eval.py:9
int osd_set_methods(struct osd_methods *in, int in_size, struct osd_methods *out)
Definition: osd.c:40
void osd_std_click(struct osd_item *this, struct navit *nav, int pressed, int button, struct point *p)
Definition: osd.c:125
struct osd * osd_new(struct attr *parent, struct attr **attrs)
Definition: osd.c:45
void osd_set_std_attr(struct attr **attrs, struct osd_item *item, int flags)
Definition: osd.c:279
void osd_std_resize(struct osd_item *item)
Definition: osd.c:145
void osd_set_std_graphic(struct navit *nav, struct osd_item *item, struct osd_priv *priv)
Sets up the graphics for an item.
Definition: osd.c:409
void osd_std_config(struct osd_item *item, struct navit *navit)
Definition: osd.c:357
int osd_get_attr(struct osd *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: osd.c:76
void osd_std_calculate_sizes(struct osd_item *item, int w, int h)
Calculates the size and position of an OSD item.
Definition: osd.c:170
void osd_fill_with_bgcolor(struct osd_item *item)
Definition: osd.c:457
void osd_wrap_point(struct point *p, struct navit *nav)
Definition: osd.c:109
int osd_set_attr(struct osd *osd, struct attr *attr)
Definition: osd.c:88
void osd_set_std_config(struct navit *nav, struct osd_item *item)
Definition: osd.c:383
void osd_set_keypress(struct navit *nav, struct osd_item *item)
Definition: osd.c:390
Definition: config_.c:47
Definition: attr.h:157
Definition: callback.c:27
Definition: color.h:23
Definition: command.c:76
Definition: graphics.h:161
graphics context A graphics context encapsulates a set of drawing parameters, such as linewidth and d...
Definition: graphics.h:180
graphics object A graphics object serves as the target for drawing operations. It encapsulates variou...
Definition: graphics.c:75
Represents an object on a map.
Definition: item.h:115
Definition: navit.c:112
Definition: osd.h:39
void(* draw)(struct osd_priv *osd, struct navit *navit, struct vehicle *v)
Definition: osd.h:40
Definition: osd.h:43
struct osd_item_methods meth
Definition: osd.h:45
struct graphics_font * font
Definition: osd.h:52
struct callback * keypress_cb
Definition: osd.h:57
int flags
Definition: osd.h:46
int do_draw
Definition: osd.h:62
struct navit * navit
Definition: osd.h:49
struct command_saved * enable_cs
Definition: osd.h:60
struct callback * reconfig_cb
Definition: osd.h:56
struct graphics_gc * graphic_fg
Definition: osd.h:51
int rel_w
Definition: osd.h:47
int rel_y
Definition: osd.h:47
char * font_name
Definition: osd.h:53
int w
Definition: osd.h:46
struct point p
Definition: osd.h:44
struct graphics_gc * graphic_bg
Definition: osd.h:51
int pressed
Definition: osd.h:58
int font_size
Definition: osd.h:46
int fg_line_width
Definition: osd.h:46
int osd_configuration
Definition: osd.h:46
struct callback * cb
Definition: osd.h:54
char * accesskey
Definition: osd.h:61
char * command
Definition: osd.h:59
struct callback * resize_cb
Definition: osd.h:55
int configured
Definition: osd.h:46
struct graphics * gr
Definition: osd.h:50
struct color color_bg color_fg text_color
Definition: osd.h:48
int rel_h
Definition: osd.h:47
struct graphics_gc * graphic_fg_text
Definition: osd.h:51
int rel_x
Definition: osd.h:47
int h
Definition: osd.h:46
Definition: osd.h:30
void(* destroy)(struct osd_priv *osd)
Definition: osd.h:33
int(* get_attr)(struct osd_priv *osd, enum attr_type type, struct attr *attr)
Definition: osd.h:34
int(* set_attr)(struct osd_priv *osd, struct attr *attr)
Definition: osd.h:32
void(* osd_destroy)(struct osd_priv *osd)
Definition: osd.h:31
Definition: osd.c:34
struct osd_priv * priv
Definition: osd.c:37
Definition: gpx2navit_txt.h:51
Definition: point.h:23
Definition: vehicle.c:59