summaryrefslogtreecommitdiff
path: root/menu.c
blob: d77457517199414b41ad8cbdd907d1ee09c0807c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <glib.h>
#include "menu.h"

void
menu_route_do_update(struct container *co)
{
#if 0
	if (co->cursor) {
#if 0 /* FIXME */
		route_set_position(co->route, cursor_pos_get(co->cursor));
#endif
		graphics_redraw(co);
		if (co->statusbar && co->statusbar->statusbar_route_update)
			co->statusbar->statusbar_route_update(co->statusbar, co->route);
	}
#endif
}

void
menu_route_update(struct container *co)
{
#if 0
	menu_route_do_update(co);
	graphics_redraw(co);
#endif
}

struct menu *
menu_add(struct menu *menu, char *name, enum menu_type type, void (*callback)(struct menu *menu, void *data1, void *data2), void *data1, void *data2)
{
	struct menu *this;
        this=g_new0(struct menu, 1);
        this->priv=(*menu->meth.add)(menu->priv, &this->meth, name, type, callback, this, data1, data2);
	if (! this->priv) {
		g_free(this);
		return NULL;
	}

	return this;	
}

void
menu_set_toggle(struct menu *menu, int active)
{
	(*menu->meth.set_toggle)(menu->priv, active);
}

int
menu_get_toggle(struct menu *menu)
{
	return (*menu->meth.get_toggle)(menu->priv);
}