… | |
… | |
19 | |
19 | |
20 | #ifndef NAVIT_GUI_H |
20 | #ifndef NAVIT_GUI_H |
21 | #define NAVIT_GUI_H |
21 | #define NAVIT_GUI_H |
22 | |
22 | |
23 | #ifdef __cplusplus |
23 | #ifdef __cplusplus |
24 | extern "C" { |
24 | extern "C" |
|
|
25 | { |
25 | #endif |
26 | #endif |
26 | struct navit; |
27 | struct navit; |
27 | struct gui_priv; |
28 | struct gui_priv; |
28 | struct menu_methods; |
29 | struct menu_methods; |
29 | struct datawindow_methods; |
30 | struct datawindow_methods; |
30 | struct callback; |
31 | struct callback; |
31 | struct graphics; |
32 | struct graphics; |
32 | struct coord; |
33 | struct coord; |
33 | struct pcoord; |
34 | struct pcoord; |
34 | |
35 | |
35 | struct gui_methods { |
36 | struct gui_methods |
|
|
37 | { |
36 | struct menu_priv *(*menubar_new)(struct gui_priv *priv, struct menu_methods *meth); |
38 | struct menu_priv *(*menubar_new)(struct gui_priv *priv, |
|
|
39 | struct menu_methods *meth); |
37 | struct menu_priv *(*popup_new)(struct gui_priv *priv, struct menu_methods *meth); |
40 | struct menu_priv *(*popup_new)(struct gui_priv *priv, |
|
|
41 | struct menu_methods *meth); |
38 | int (*set_graphics)(struct gui_priv *priv, struct graphics *gra); |
42 | int (*set_graphics)(struct gui_priv *priv, struct graphics *gra); |
39 | int (*run_main_loop)(struct gui_priv *priv); |
43 | int (*run_main_loop)(struct gui_priv *priv); |
40 | struct datawindow_priv *(*datawindow_new)(struct gui_priv *priv, char *name, struct callback *click, struct callback *close, struct datawindow_methods *meth); |
44 | struct datawindow_priv *(*datawindow_new)(struct gui_priv *priv, |
|
|
45 | char *name, struct callback *click, struct callback *close, |
|
|
46 | struct datawindow_methods *meth); |
41 | int (*add_bookmark)(struct gui_priv *priv, struct pcoord *c, char *description); |
47 | int (*add_bookmark)(struct gui_priv *priv, struct pcoord *c, |
|
|
48 | char *description); |
42 | void (*disable_suspend)(struct gui_priv *priv); |
49 | void (*disable_suspend)(struct gui_priv *priv); |
43 | int (*get_attr)(struct gui_priv *priv, enum attr_type type, struct attr *attr); |
50 | int (*get_attr)(struct gui_priv *priv, enum attr_type type, |
|
|
51 | struct attr *attr); |
44 | int (*add_attr)(struct gui_priv *priv, struct attr *attr); |
52 | int (*add_attr)(struct gui_priv *priv, struct attr *attr); |
45 | int (*set_attr)(struct gui_priv *priv, struct attr *attr); |
53 | int (*set_attr)(struct gui_priv *priv, struct attr *attr); |
46 | }; |
54 | }; |
47 | |
|
|
48 | |
55 | |
49 | /* prototypes */ |
56 | /* prototypes */ |
50 | enum attr_type; |
57 | enum attr_type; |
51 | struct attr; |
58 | struct attr; |
52 | struct attr_iter; |
59 | struct attr_iter; |
… | |
… | |
55 | struct graphics; |
62 | struct graphics; |
56 | struct gui; |
63 | struct gui; |
57 | struct menu; |
64 | struct menu; |
58 | struct pcoord; |
65 | struct pcoord; |
59 | struct gui *gui_new(struct attr *parent, struct attr **attrs); |
66 | struct gui *gui_new(struct attr *parent, struct attr **attrs); |
60 | int gui_get_attr(struct gui *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter); |
67 | int gui_get_attr(struct gui *this_, enum attr_type type, struct attr *attr, |
|
|
68 | struct attr_iter *iter); |
61 | int gui_set_attr(struct gui *this_, struct attr *attr); |
69 | int gui_set_attr(struct gui *this_, struct attr *attr); |
62 | int gui_add_attr(struct gui *this_, struct attr *attr); |
70 | int gui_add_attr(struct gui *this_, struct attr *attr); |
63 | struct menu *gui_menubar_new(struct gui *gui); |
71 | struct menu *gui_menubar_new(struct gui *gui); |
64 | struct menu *gui_popup_new(struct gui *gui); |
72 | struct menu *gui_popup_new(struct gui *gui); |
65 | struct datawindow *gui_datawindow_new(struct gui *gui, char *name, struct callback *click, struct callback *close); |
73 | struct datawindow *gui_datawindow_new(struct gui *gui, char *name, |
|
|
74 | struct callback *click, struct callback *close); |
66 | int gui_add_bookmark(struct gui *gui, struct pcoord *c, char *description); |
75 | int gui_add_bookmark(struct gui *gui, struct pcoord *c, char *description); |
67 | int gui_set_graphics(struct gui *this_, struct graphics *gra); |
76 | int gui_set_graphics(struct gui *this_, struct graphics *gra); |
68 | void gui_disable_suspend(struct gui *this_); |
77 | void gui_disable_suspend(struct gui *this_); |
69 | int gui_has_main_loop(struct gui *this_); |
78 | int gui_has_main_loop(struct gui *this_); |
70 | int gui_run_main_loop(struct gui *this_); |
79 | int gui_run_main_loop(struct gui *this_); |