<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> Hi Richard, CC: all,<br>><br>> I am recently thinking about how to deal with c++ template class in QT/KDE
<br>> bindings.<br>> Inside QT4 I found three places where templates get involved:<br>> 1) typedef<br>You need to be able to marshaller each typedef'd variant of the template</blockquote><div><br>yes, the disadvantage is to collect all involved ones priorly.  I am working on a 
<br>script to build the list. <br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> 2) function parameter, return type<br>A lot of the template types are lists or hashes, and the solution that
<br>qtruby/qyoto uses is to have marshallers <--> bindings language as templated<br>code. This means you only write the marshalling code once, and then have a<br>different template type for each the the C++ template types with a macro to
<br>invoke it. See the code in handlers.cpp of either the QtRuby or Qyoto<br>projects for a example. For instance, this line:<br><br>DEF_VALUELIST_MARSHALLER( QUrlList, QList<QUrl>, QUrl )<br><br>The DEF_VALUELIST_MARSHALLER() will define a new template based marshaller for
<br>QLists of QUrls.<br><br>> 3) QT signal, slot<br>You can't have have commas in signal and slot types, but you can have simple<br>template types. The template types are mostly lists which have to be<br>marshalled as Arrays or Lists in the bindings language.
</blockquote><div><br>yes, noticed that. Just 4 or 5 found in my current QT4 headers.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> It is a little bit hard to support template class inside scripting<br>> language, how do you<br>> make it available for qtruby (or not) ? This was not mentioned on<br>> kdebindings ruby<br>> page. Sorry I am totally new to ruby.
<br>><br>> Idea in my mind is:<br>> 1) get all template declarations from source;<br>> 2) introduce a base template in perl for those types which share the same<br>> base template<br>>     like QList<Q3DockWindow *>, QList<Q3ToolBar *> we create QList.
<br>>     such base template can create a specific namespace for demanded type<br>> runtimely, say<br>>     QList_Q3DockWindow_Ptr (cached in future), and push all available<br>> methods into it.<br>>     Inside QList c++ code holds a function dictionary to cast generic
<br>> pointer from vm to<br>>     template type instance (possibly by interpret_cast or static_cast);<br>Yes, that sounds similar to the code in handlers.cpp that I describe above.<br><br>> Could you pls explain something you've done in qtbudy or your ideas?
<br>> From my personal point of view, that'll be nice if we can setup a generic<br>> solution, across<br>> different scripting languages.<br>Well, yes that is the idea of the Smoke library. And it allows the code for
<br>the QtRuby bindings (derived from PerlQt), and the Qyoto C# bindings to be<br>very similar.</blockquote><div><br>The way to keep instance pointer differ in various languages. That'll be nice <br>to define marshall layer plugin for each one and plug to use.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Note that I think someone is working on a Qt4 version of the Smoke based<br>PerlQt, and you need to be a bit careful about naming your project something
<br>different from just 'PerlQt' to avoid confusion.</blockquote><div><br>namespace is ok.  I'd like to know him/her. Is him/her on the maillist? <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-- Richard<br><br><br><br>------------------------------<br><br>Message: 4<br>Date: Thu, 26 Apr 2007 18:06:51 +0200<br>From: Arno Rehn <<a href="mailto:arno@arnorehn.de">arno@arnorehn.de</a>><br>Subject: [Kde-bindings] First release of Qyoto
<br>To: <a href="mailto:kde-bindings@kde.org">kde-bindings@kde.org</a><br>Message-ID: <<a href="mailto:200704261806.51778.arno@arnorehn.de">200704261806.51778.arno@arnorehn.de</a>><br>Content-Type: text/plain;  charset="utf-8"
<br><br>Hi,<br><br>I think we can do a first release of Qyoto by now.<br>Everything on the TODO list has been done, except maybe the translation of<br>more Qt examples to C#. But for a very first release this is not that much
<br>important, in my opinion.<br>Is there anything that still has to be done? I can't think of anything at the<br>moment.<br>What do you think?<br><br>--<br>Arno Rehn<br><a href="mailto:arno@arnorehn.de">arno@arnorehn.de
</a><br><br><br>------------------------------<br><br>Message: 5<br>Date: Thu, 26 Apr 2007 18:24:06 +0000<br>From: Richard Dale <<a href="mailto:Richard_Dale@tipitina.demon.co.uk">Richard_Dale@tipitina.demon.co.uk</a>>
<br>Subject: [Kde-bindings] KDE/kdebindings/kalyptus<br>To: <a href="mailto:kde-commits@kde.org">kde-commits@kde.org</a><br>Cc: <a href="mailto:kde-bindings@kde.org">kde-bindings@kde.org</a><br>Message-ID: <<a href="mailto:1177611846.248662.10938.nullmailer@svn.kde.org">
1177611846.248662.10938.nullmailer@svn.kde.org</a>><br>Content-Type: text/plain; charset=UTF-8<br><br>SVN commit 658331 by rdale:<br><br>* Some improvements for the code generation of the KDE kimono classes<br><br>CCMAIL: 
<a href="mailto:kde-bindings@kde.org">kde-bindings@kde.org</a><br><br><br><br> M  +116 -59   kalyptusCxxToKimono.pm<br> M  +6 -33     kalyptusDataDict.pm<br><br><br><br><br>------------------------------<br><br>Message: 6
<br>Date: Thu, 26 Apr 2007 19:24:20 +0100<br>From: Richard Dale <<a href="mailto:rdale@foton.es">rdale@foton.es</a>><br>Subject: Re: [Kde-bindings] First release of Qyoto<br>To: KDE bindings for other programming languages
<br>        <<a href="mailto:kde-bindings@kde.org">kde-bindings@kde.org</a>><br>Message-ID: <<a href="mailto:200704261924.20831.rdale@foton.es">200704261924.20831.rdale@foton.es</a>><br>Content-Type: text/plain;  charset="iso-8859-1"
<br><br>On Thursday 26 April 2007, Arno Rehn wrote:<br>> Hi,<br>><br>> I think we can do a first release of Qyoto by now.<br>> Everything on the TODO list has been done, except maybe the translation of<br>> more Qt examples to C#. But for a very first release this is not that much
<br>> important, in my opinion.<br>> Is there anything that still has to be done? I can't think of anything at<br>> the moment.<br>> What do you think?<br>As far as I know, only out argument types need doing. I'm going away for two
<br>weeks on Sunday though.<br><br>I've recently been working on the code generation for the KDE classes, and<br>I'll check in what I have. It doesn't compile yet, but isn't far off.<br>Change '-fsmoke' to '-fkimono' in kdebindings/smoke/kde/generate.pl and
<br>run 'perl generate.pl' to have a look.<br><br>-- Richard<br><br><br><br>------------------------------<br><br>Message: 7<br>Date: Thu, 26 Apr 2007 21:22:12 +0000<br>From: Richard Dale <<a href="mailto:Richard_Dale@tipitina.demon.co.uk">
Richard_Dale@tipitina.demon.co.uk</a>><br>Subject: [Kde-bindings] KDE/kdebindings/csharp/qyoto<br>To: <a href="mailto:kde-commits@kde.org">kde-commits@kde.org</a><br>Cc: <a href="mailto:kde-bindings@kde.org">kde-bindings@kde.org
</a><br>Message-ID: <<a href="mailto:1177622532.600979.27768.nullmailer@svn.kde.org">1177622532.600979.27768.nullmailer@svn.kde.org</a>><br>Content-Type: text/plain; charset=UTF-8<br><br>SVN commit 658365 by rdale:<br>
<br>* The classes which need to have interfaces, such as QUrl because they<br>  are used with multiple inheritance in C++, were always being defined<br>  as interface types in method arguments. This isn't needed, so change
<br>  arg types from 'IQUrl' etc to 'QUrl' etc.<br><br>CCMAIL: <a href="mailto:kde-bindings@kde.org">kde-bindings@kde.org</a><br><br><br><br> M  +7 -0      ChangeLog<br> M  +14 -14    core/QUrl.cs<br> M  +4 -4      core/QVariant.cs
<br> M  +4 -4      core/Qt.cs<br> M  +1 -4      gui/QAccessibleApplication.cs<br> M  +1 -2      gui/QAccessibleInterface.cs<br> M  +1 -4      gui/QAccessibleWidget.cs<br> M  +1 -4      gui/QAccessibleWidgetEx.cs<br> M  +8 -8      gui/QBoxLayout.cs
<br> M  +2 -2      gui/QDesktopServices.cs<br> M  +14 -14    gui/QGridLayout.cs<br> M  +5 -5      gui/QLayout.cs<br> M  +2 -2      gui/QPolygon.cs<br> M  +2 -2      gui/QPolygonF.cs<br> M  +6 -6      gui/QStackedLayout.cs
<br> M  +10 -10    gui/QTextBrowser.cs<br> M  +6 -6      gui/QTextDocument.cs<br> M  +2 -2      gui/QTextEdit.cs<br> M  +2 -2      network/QUrlInfo.cs<br> M  +1 -0      qdbus/QDBusArgument.cs<br> M  +4 -4      sql/QSqlDatabase.cs
<br> M  +2 -2      sql/QSqlQuery.cs<br> M  +4 -4      sql/QSqlQueryModel.cs<br> M  +2 -2      sql/QSqlTableModel.cs<br> M  +2 -4      xml/QXmlDefaultHandler.cs<br> M  +1 -3      xml/QXmlEntityResolver.cs<br> M  +10 -10    xml/QXmlReader.cs
<br> M  +20 -20    xml/QXmlSimpleReader.cs<br><br><br><br><br>------------------------------<br><br>_______________________________________________<br>Kde-bindings mailing list<br><a href="mailto:Kde-bindings@kde.org">Kde-bindings@kde.org
</a><br><a href="https://mail.kde.org/mailman/listinfo/kde-bindings">https://mail.kde.org/mailman/listinfo/kde-bindings</a><br><br><br>End of Kde-bindings Digest, Vol 48, Issue 21<br>********************************************
<br></blockquote></div><br><br clear="all"><br>-- <br>cheers,<br>-dongxu<br>__END__<br><a href="http://search.cpan.org/~dongxu">http://search.cpan.org/~dongxu</a>