Difference between revisions of "Embedding"

From Navit's Wiki
Jump to: navigation, search
(Added info about NAVIT_XID)
(formating)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
You can embed navit in to ways: you can make navit embed itself by setting NAVIT_XID to the container into that navit should be embedded.
+
You can embed navit in two ways: you can make navit embed itself by setting NAVIT_XID.
You can also "pull" navit by using a corresponding function of your project (e.g. void QX11EmbedContainer::embedClient(WId id) for Qt 4.4).
+
 
 +
Here is a Qt sample to embed navit's window into your own window:
 +
 
 +
<source lang="cpp">
 +
container = new QX11EmbedContainer(this);
 +
QString wId = QString::number(container->winId());
 +
setenv("NAVIT_XID", wId.toAscii(), 1);
 +
process = new QProcess(container);
 +
process->start("navit");
 +
</source>
 +
Navit can also get "pulled" by using a corresponding function of your project (e.g. void QX11EmbedContainer::embedClient(WId id) for Qt 4.4).
  
 
Here is a gtk sample to embed navit's window into you own window: http://libgarmin.sf.net/zfe.tgz  
 
Here is a gtk sample to embed navit's window into you own window: http://libgarmin.sf.net/zfe.tgz  
  
See also [[Dbus]] to learn about the brand new dbus interface.
+
==See also==
 +
*[[Dbus]]
 +
 
 +
[[Category:Development]]

Latest revision as of 10:53, 26 December 2012

You can embed navit in two ways: you can make navit embed itself by setting NAVIT_XID.

Here is a Qt sample to embed navit's window into your own window:

 container = new QX11EmbedContainer(this);
 QString wId = QString::number(container->winId());
 setenv("NAVIT_XID", wId.toAscii(), 1);
 process = new QProcess(container);
 process->start("navit");

Navit can also get "pulled" by using a corresponding function of your project (e.g. void QX11EmbedContainer::embedClient(WId id) for Qt 4.4).

Here is a gtk sample to embed navit's window into you own window: http://libgarmin.sf.net/zfe.tgz

See also[edit]