Add:gui_internal:Add via navit.xml configurable menus, expect some screwups the next...
[navit-package] / navit / gui.h
1 /**
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_GUI_H
21 #define NAVIT_GUI_H
22
23 struct navit;
24 struct gui_priv;
25 struct menu_methods;
26 struct datawindow_methods;
27 struct callback;
28 struct graphics;
29 struct coord;
30 struct pcoord;
31
32 struct gui_methods {
33         struct menu_priv *(*menubar_new)(struct gui_priv *priv, struct menu_methods *meth);
34         struct menu_priv *(*popup_new)(struct gui_priv *priv, struct menu_methods *meth);
35         int (*set_graphics)(struct gui_priv *priv, struct graphics *gra);
36         int (*run_main_loop)(struct gui_priv *priv);
37         struct datawindow_priv *(*datawindow_new)(struct gui_priv *priv, char *name, struct callback *click, struct callback *close, struct datawindow_methods *meth);
38         int (*add_bookmark)(struct gui_priv *priv, struct pcoord *c, char *description);
39         void (*disable_suspend)(struct gui_priv *priv);
40         int (*get_attr)(struct gui_priv *priv, enum attr_type type, struct attr *attr);
41         int (*add_attr)(struct gui_priv *priv, struct attr *attr);
42 };
43
44
45 /* prototypes */
46 enum attr_type;
47 struct attr;
48 struct attr_iter;
49 struct callback;
50 struct datawindow;
51 struct graphics;
52 struct gui;
53 struct menu;
54 struct pcoord;
55 struct gui *gui_new(struct attr *parent, struct attr **attrs);
56 int gui_get_attr(struct gui *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
57 int gui_add_attr(struct gui *this_, struct attr *attr);
58 struct menu *gui_menubar_new(struct gui *gui);
59 struct menu *gui_popup_new(struct gui *gui);
60 struct datawindow *gui_datawindow_new(struct gui *gui, char *name, struct callback *click, struct callback *close);
61 int gui_add_bookmark(struct gui *gui, struct pcoord *c, char *description);
62 int gui_set_graphics(struct gui *this_, struct graphics *gra);
63 void gui_disable_suspend(struct gui *this_);
64 int gui_has_main_loop(struct gui *this_);
65 int gui_run_main_loop(struct gui *this_);
66 /* end of prototypes */
67
68 #endif
69