[Qgis-developer] Some concerns about QGIS on OS X, part 3
Benjamin Ducke
benjamin.ducke at oxfordarch.co.uk
Tue Feb 10 06:47:11 EST 2009
Go ahead and create all those interfaces if you like. Most people
I know, however, seem to be quite happy with C++ and Python.
Any language that does not have an open source implementation or
is not available for all QGIS-supported OS seems to be a waste of
time, though.
Ben
Mac Programmer wrote:
> Many programmers, particularly new programmers, prefer to use LWOHF
> (languages without header files). I'm thinking here of the .NET
> languages C#, VB.NET and Delphi Prism (nee Oxygene) or Object Pascal as
> implemented in Delphi and Free Pascal. Currently QGIS only provides two
> extremes for adding value, C++ and Python. If this were 1999, in the
> heyday of desktop development, perhaps these traditional languages would
> make sense. But if we're living in 2009, or planning for, say, 2011, it
> would seem as though also having choices somewhere in the middle of the
> language spectrum would help QGIS adoption.
>
> What about proceduralizing the QGIS API similar to the way Den Jean has
> proceduralized much of the Qt API?
>
> http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html
>
> This would open up QGIS to most languages that can import C libraries.
>
> In my experience, C++ in the hands of even good programmers often
> results in unstable, fragile, difficult-to-maintain code, whereas Python
> is, well, a scripting language. Certainly Python has its uses and fTools
> and the Plugin Installer are excellent examples of how far you can take
> Python. But there are also many cases where Python is not appropriate
> and a compiled language is needed. (cf. the performance issues of the
> Python "Sugar" front-end and Python "activities" (apps) on the One
> Laptop Per Child (OLPC) computers.)
>
> Following Den's lead, an interface library written in C++ that flattens
> the QGIS API might look like this:
>
> #include <qgsapplication.h>
> #include "qgsapplication.hb"
>
> QgsApplicationH QgsApplication_create(int* argc, char** argv, int p3)
> {
> return (QgsApplicationH) new QgsApplication(*(int*)argc, argv, p3);
> }
>
> void QgsApplication_destroy(QgsApplicationH handle)
> {
> delete (QgsApplication *)handle;
> }
>
> int QgsApplication_exec()
> {
> return (int) QgsApplication::exec();
> }
>
> In Pascal, this library's functions can be imported like this:
>
> function QgsApplication_create(argc: PInteger; argv: PPAnsiChar; p3:
> Integer = QT_VERSION): QgsApplicationH; overload; cdecl; external
> QgisIntf name 'QgsApplication_create';
> procedure QgsApplication_destroy(handle: QgsApplicationH); cdecl;
> external QgisIntf name 'QgsApplication_destroy';
> function QgsApplication_exec(): Integer; cdecl; external QgisIntf name
> 'QgsApplication_exec';
>
> I've already tested this and it does work on OS X. I would follow up
> with more of this interface library, but I'm not sure I'm qualified -
> I'm not much of a C++ programmer, I have no GIS background, and I have
> no understanding of QGIS's architecture. Maybe there's somebody less
> error prone in this area who would be interested.
>
> Again, the objective here is to make adding value to QGIS as painless as
> possible.
>
> Thanks.
>
> -Phil
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
--
Benjamin Ducke
Senior Applications Support and Development Officer
Oxford Archaeology Ltd
Janus House
Osney Mead
OX2 0ES
Oxford, U.K.
Tel: +44 (0)1865 263 800 (switchboard)
Tel: +44 (0)1865 980 758 (direct)
Fax :+44 (0)1865 793 496
benjamin.ducke at oxfordarch.co.uk
------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.
More information about the Qgis-developer
mailing list