Hi Tim, Charlie,

Thanks for your answers.


The best is to look at src/gui/qgisinterface.h which shows the various
methods and objects available to the api. You can also manipulate the
main window app from within you plugin via qGisInterface->mainWindow()

OK, that is useful. But I actually meant the interface a plugin has to implement. Of course I can look in the source and that will be QgisPlugin. It is small, I like it.



I can imagine the API is not binary compatible for some upgrades (usually it
is extended so then still compatible, depending on the model used). Is there
not a mechanism to check if a plugin corresponds to the version of the host
(qgis)? I think this is feasable...
Yes the version is available within the QGIS namespace: QGis::QGIS_VERSION

What I mean is this: adding one method to QgisPlugin, e.g.:
virtual int interfaceVersion() = 0;

which gives back a interface_version_number. That number only changes if the (plugin) interface changes. QGis can check if the plugin does implement the right interface.

But I now understand better that if the plugin calls back the qgis API, also that interface has to be stable. So in practice this will indeed change with every version. But anyway, even then, qgis can check that number as its first action and discard that plugin if the interface_version_number is wrong.

So IMO it is not this:
//! Version of the plugin
QString & version()

Because that is the version of the plugin, obviously, and not the version of the ABI/API.




We maintain backwards compatibility for API. So if a method name
changes for example the old name must remain as a wrapper for the new
method. Old methods are marked as deprecated in the docs and in major
releases (e.g. upcoming 2.0) we will shed deprecated methods from the
API.

Because we use C++ ABI compatibility is not possible between versions.
This doesnt affect python (as the plugins only need the same language
binding elements to be present) so it is an advantage for python that
its not vulnerable to lib updates.

Understood.


Regards, Barend

_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to