navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
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;
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 
void osd_fill_with_bgcolor(struct osd_item *item)
Definition: osd.c:457
attr_type
Definition: attr.h:34
int osd_configuration
Definition: osd.h:46
unsigned char p[5]
Definition: mg.h:48
Definition: osd.h:39
Definition: gpx2navit_txt.h:51
struct navit * navit
Definition: osd.h:49
int do_draw
Definition: osd.h:62
Definition: item.h:99
int(* set_attr)(struct osd_priv *osd, struct attr *attr)
Definition: osd.h:32
Definition: color.h:23
graphics context A graphics context encapsulates a set of drawing parameters, such as linewidth and d...
Definition: graphics.h:179
struct osd * osd_new(struct attr *parent, struct attr **attrs)
Definition: osd.c:45
int rel_w
Definition: osd.h:47
void(* osd_destroy)(struct osd_priv *osd)
Definition: osd.h:31
struct graphics_gc * graphic_fg_text
Definition: osd.h:51
Definition: vehicle.c:58
int osd_get_attr(struct osd *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: osd.c:76
int flags
Definition: osd.h:46
void osd_std_resize(struct osd_item *item)
Definition: osd.c:145
int rel_h
Definition: osd.h:47
char * font_name
Definition: osd.h:53
struct osd_item_methods meth
Definition: osd.h:45
struct callback * cb
Definition: osd.h:54
Definition: graphics.h:161
struct color color_bg color_fg text_color
Definition: osd.h:48
void osd_std_click(struct osd_item *this, struct navit *nav, int pressed, int button, struct point *p)
Definition: osd.c:125
char * command
Definition: osd.h:59
void(* draw)(struct osd_priv *osd, struct navit *navit, struct vehicle *v)
Definition: osd.h:40
struct graphics_font * font
Definition: osd.h:52
graphics object A graphics object serves as the target for drawing operations. It encapsulates variou...
Definition: graphics.c:70
Definition: config_.c:47
struct command_saved * enable_cs
Definition: osd.h:60
int osd_set_attr(struct osd *osd, struct attr *attr)
Definition: osd.c:88
struct graphics * gr
Definition: osd.h:50
Definition: osd.h:30
Definition: attr.h:156
struct callback * keypress_cb
Definition: osd.h:57
void(* destroy)(struct osd_priv *osd)
Definition: osd.h:33
struct callback * resize_cb
Definition: osd.h:55
int(* get_attr)(struct osd_priv *osd, enum attr_type type, struct attr *attr)
Definition: osd.h:34
void osd_set_std_attr(struct attr **attrs, struct osd_item *item, int flags)
Definition: osd.c:279
void osd_set_std_config(struct navit *nav, struct osd_item *item)
Definition: osd.c:383
Definition: callback.c:26
int osd_set_methods(struct osd_methods *in, int in_size, struct osd_methods *out)
Definition: osd.c:40
char * accesskey
Definition: osd.h:61
struct graphics_gc * graphic_bg
Definition: osd.h:51
int w
Definition: osd.h:46
Definition: point.h:23
struct graphics_gc * graphic_fg
Definition: osd.h:51
Definition: osd.h:43
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
Definition: osd.c:34
int pressed
Definition: osd.h:58
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
int rel_x
Definition: osd.h:47
int font_size
Definition: osd.h:46
struct osd_priv * priv
Definition: osd.c:37
typedef int(WINAPI *FP_SetStretchBltMode)(HDC dc
struct callback * reconfig_cb
Definition: osd.h:56
char type[3]
Definition: garmin_img.c:123
struct point p
Definition: osd.h:44
Definition: navit.c:111
int rel_y
Definition: osd.h:47
tuple navit
Definition: eval.py:9
int h
Definition: osd.h:46
void osd_wrap_point(struct point *p, struct navit *nav)
Definition: osd.c:109
void osd_std_config(struct osd_item *item, struct navit *navit)
Definition: osd.c:357
Definition: command.c:76
void osd_set_keypress(struct navit *nav, struct osd_item *item)
Definition: osd.c:390
flags
Definition: gui_internal.h:26
int configured
Definition: osd.h:46
int fg_line_width
Definition: osd.h:46