viktorgino / headunit-desktop

HeadUnit Desktop is a car PC software built with Qt 5 and QML
https://github.com/viktorgino/headunit-desktop/wiki
GNU General Public License v3.0
285 stars 64 forks source link

Navit plugin #38

Closed viktorgino closed 2 years ago

viktorgino commented 5 years ago

Navit uses a plugin system where each GUI plugin has to be registered by plugin_register_category_gui the QML plugin is registered and initialized here: https://github.com/navit-gps/navit/blob/trunk/navit/gui/qt5_qml/gui_qt5_qml.cpp we need to create a GUI plugin for navit that is based on this, but fits in with how the HUD plugin system works

viktorgino commented 5 years ago

The way navit loads the GUI on Linux, is the following:

int main(int argc, char **argv) -> int main_real(int argc, char const argv) -> ???? loads the config xml and parses it ?? -> void navitinit(struct navit *this) -> int gui_setgraphics(struct gui *this, struct graphics *gra) -> static int gui_qt5_qml_set_graphics(struct gui_priv gui_priv, struct graphics gra)

pgrandin commented 5 years ago

I don't think that this has been tested with QT5 yet, but there was a few QT4 apps embedding navit using this method : https://wiki.navit-project.org/index.php/Embedding

viktorgino commented 5 years ago

Thanks @pgrandin as it seems we will have to apply some patches to navit to be able to embed it, but once the QML gui is done then it will be a lot easier than it is now. The changes that are needed currently can be seen in this commit : https://github.com/viktorgino/navit/commit/a70e4f6ff2cf3099bc2513b6630f82dbbc8b5aa4

viktorgino commented 5 years ago

Just to give a heads-up to anyone following: I started working on a QML based UI for navit, more details here : https://github.com/navit-gps/navit-gui-qt5/tree/master/prototypes