<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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.<div><br></div><div>What about proceduralizing the QGIS API similar to the way Den Jean has proceduralized much of the Qt API?</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html">http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This would open up QGIS to most languages that can import C libraries.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">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.)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Following Den's lead, an interface library written in C++ that flattens the QGIS API might look like this:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div>#include <qgsapplication.h></div><div>#include "qgsapplication.hb"</div><div><br></div><div>QgsApplicationH QgsApplication_create(int* argc, char** argv, int p3)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return (QgsApplicationH) new QgsApplication(*(int*)argc, argv, p3);</div><div>}</div><div><br></div><div>void QgsApplication_destroy(QgsApplicationH handle)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>delete (QgsApplication *)handle;</div><div>}</div><div><br></div><div>int QgsApplication_exec()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return (int) QgsApplication::exec();</div><div>}</div><div><br></div><div>In Pascal, this library's functions can be imported like this:</div><div><br></div><div><div>function QgsApplication_create(argc: PInteger; argv: PPAnsiChar; p3: Integer = QT_VERSION): QgsApplicationH; overload; cdecl; external QgisIntf name 'QgsApplication_create';</div><div>procedure QgsApplication_destroy(handle: QgsApplicationH); cdecl; external QgisIntf name 'QgsApplication_destroy'; </div><div>function QgsApplication_exec(): Integer; cdecl; external QgisIntf name 'QgsApplication_exec';</div><div><br></div><div>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.</div><div><br></div><div>Again, the objective here is to make adding value to QGIS as painless as possible.</div><div><br></div><div>Thanks.</div><div><br></div><div>-Phil</div><div><br></div></div></div></div></body></html>