Merge with modular_map
[navit-package] / src / menu.c
1 #include <glib.h>
2 #include "menu.h"
3
4 void
5 menu_route_do_update(struct container *co)
6 {
7 #if 0
8         if (co->cursor) {
9 #if 0 /* FIXME */
10                 route_set_position(co->route, cursor_pos_get(co->cursor));
11 #endif
12                 graphics_redraw(co);
13                 if (co->statusbar && co->statusbar->statusbar_route_update)
14                         co->statusbar->statusbar_route_update(co->statusbar, co->route);
15         }
16 #endif
17 }
18
19 void
20 menu_route_update(struct container *co)
21 {
22 #if 0
23         menu_route_do_update(co);
24         graphics_redraw(co);
25 #endif
26 }
27
28 struct menu *
29 menu_add(struct menu *menu, char *name, enum menu_type type, void (*callback)(struct menu *menu, void *data1, void *data2), void *data1, void *data2)
30 {
31         struct menu *this;
32         this=g_new0(struct menu, 1);
33         this->priv=(*menu->meth.add)(menu->priv, &this->meth, name, type, callback, this, data1, data2);
34         if (! this->priv) {
35                 g_free(this);
36                 return NULL;
37         }
38
39         return this;    
40 }
41
42 void
43 menu_set_toggle(struct menu *menu, int active)
44 {
45         (*menu->meth.set_toggle)(menu->priv, active);
46 }
47
48 int
49 menu_get_toggle(struct menu *menu)
50 {
51         return (*menu->meth.get_toggle)(menu->priv);
52 }