How to wrap wxWidgets for a new language?

25 views
Skip to first unread message

Sunny

unread,
Oct 2, 2011, 12:20:59 AM10/2/11
to wx-dev
Hi All!
I am a new guy here. Please allow me to ask a question.
If I want to warp wxWidgets for a language. What pre-knowledge should
I know?
What the steps about warp?
I will very appreciate for your answers! Thank you!
Sun

Igor Korot

unread,
Oct 2, 2011, 5:41:03 PM10/2/11
to wx-...@googlegroups.com
Hi,

What language you are looking for?

Thank you.

> Sun
>
> --
> To unsubscribe, send email to wx-dev+un...@googlegroups.com
> or visit http://groups.google.com/group/wx-dev
>

孙波翔

unread,
Oct 3, 2011, 12:58:11 AM10/3/11
to wx-...@googlegroups.com
Hi.
Thanks for your reply.
The language is Ada. wxAda was dead. So I want to restart it.
Sun

2011/10/3, Igor Korot <ikor...@gmail.com>:

Igor Korot

unread,
Oct 3, 2011, 1:43:33 AM10/3/11
to wx-...@googlegroups.com
Hi,

On Sun, Oct 2, 2011 at 9:58 PM, 孙波翔 <daeta...@gmail.com> wrote:
> Hi.
> Thanks for your reply.
> The language is Ada. wxAda was dead. So I want to restart it.

Well, you have something to begin with.
Try to build wxAda first based on the current SVN TRUNK - AKA 2.9.3.

If you have any questions, you can post them here.

BTW which platform will be you development one?

Thank you.

孙波翔

unread,
Oct 3, 2011, 5:32:43 AM10/3/11
to wx-...@googlegroups.com
2011/10/3, Igor Korot <ikor...@gmail.com>:
> Hi,
>
> On Sun, Oct 2, 2011 at 9:58 PM, 孙波翔 <daeta...@gmail.com> wrote:
>> Hi.
>> Thanks for your reply.
>> The language is Ada. wxAda was dead. So I want to restart it.
>
> Well, you have something to begin with.
> Try to build wxAda first based on the current SVN TRUNK - AKA 2.9.3.
>
Excuse me, what is AKA?

> If you have any questions, you can post them here.
>
> BTW which platform will be you development one?
>
Now I am use GPS as IDE to compile the Ada code.
But use other language, such as Java or Python, I use Eclipse
Thank you..

Robin Dunn

unread,
Oct 3, 2011, 3:23:39 PM10/3/11
to wx-...@googlegroups.com

You may want to look at what I am working on for the next generation of
wxPython:

http://wiki.wxpython.org/ProjectPhoenix
http://trac.wxwidgets.org/browser/wxPython/Phoenix/trunk

Basically we are taking the XML output from Doxygen's processing of the
wx documentation/interface files and using that XML to generate code for
the wrappers. Currently code is being generated for SIP, but the design
should allow other generators to be plugged in without too much hassle.
It could even generate the C wrapper code if there isn't a tool like
SIP or SWIG available that you wanted to use for a backend generator
There is some Python-specific and SIP-specific stuff in the tweaker code
but I've been implementing ways as I think of them to either make those
things more generic or to be easily ignored by other generators.

--
Robin Dunn
Software Craftsman
http://wxPython.org

JGM

unread,
Oct 3, 2011, 5:23:17 PM10/3/11
to wx-dev
Interesting, at wxPHP we are taking the same approach of using the xml
files generated by doxygen to extract the necessary data and generate
the php extension code of wxWidgets.

Here is the code I have written so far using php itself:

http://wxphp.org/files/run-new.php.txt

This codes generates 3 files classes.dump, enums.dump and consts.dump
Each file has a serialized php array with the data found to assist on
the C code generation of the extension, previously wxPHP used gccxml
for this by parsing the wxWidget sources, but gccxml has many
drawbacks and inconsistencies while with the doxygen output we get a
much precise output.

maybe we can share some ideas or work out some kind of
collaboration :)

Regards!
Jefferson - http://wxphp.org/

Krishna

unread,
Oct 4, 2011, 9:41:15 AM10/4/11
to wx-...@googlegroups.com
Hello Robin,

On Tue, Oct 4, 2011 at 12:53 AM, Robin Dunn <ro...@alldunn.com> wrote:

> You may want to look at what I am working on for the next generation of
> wxPython:
>
>        http://wiki.wxpython.org/ProjectPhoenix
>        http://trac.wxwidgets.org/browser/wxPython/Phoenix/trunk
>
> Basically we are taking the XML output from Doxygen's processing of the wx
> documentation/interface files and using that XML to generate code for the
> wrappers.  Currently code is being generated for SIP, but the design should
> allow other generators to be plugged in without too much hassle.  It could
> even generate the C wrapper code if there isn't a tool like SIP or SWIG
> available that you wanted to use for a backend generator There is some
> Python-specific and SIP-specific stuff in the tweaker code but I've been
> implementing ways as I think of them to either make those things more
> generic or to be easily ignored by other generators.
>

Phoenix looks interesting. Thanks!

Have you looked at SMOKE[1] ? If so, how does it compare to Phoenix?
The KDE people have been using it to generate complete bindings for
ruby, perl and php.

cheers,
--krishna

[1] http://techbase.kde.org/Development/Languages/Smoke

--
Programming is difficult business.
It should never be undertaken in ignorance.
--Douglas Crockford, "Javascript: The Good Parts"

Robin Dunn

unread,
Oct 5, 2011, 5:59:39 PM10/5/11
to wx-...@googlegroups.com
On 10/3/11 2:23 PM, JGM wrote:
> Interesting, at wxPHP we are taking the same approach of using the xml
> files generated by doxygen to extract the necessary data and generate
> the php extension code of wxWidgets.
>
> Here is the code I have written so far using php itself:
>
> http://wxphp.org/files/run-new.php.txt
>
> This codes generates 3 files classes.dump, enums.dump and consts.dump
> Each file has a serialized php array with the data found to assist on
> the C code generation of the extension, previously wxPHP used gccxml
> for this by parsing the wxWidget sources, but gccxml has many
> drawbacks and inconsistencies while with the doxygen output we get a
> much precise output.
>
> maybe we can share some ideas or work out some kind of
> collaboration :)

Yep, that is possible. I've tried to design things in Phoenix such that
it can be useful for other target languages, although like I said before
there are some things here and there that are specific to my needs, but
for the most part they should be able to be ignored or worked around for
other targets. I've also designed things so that you should be able to
use most of what I'm doing for Python, or you can use just the
extractors and the basic framework and do the tweaking stage your own way.

If you want to evaluate feasibility of using the Phoenix framework you
can probably start looking at the current sip generator here:
http://trac.wxwidgets.org/browser/wxPython/Phoenix/trunk/etgtools/sip_generator.py
The generate() method in that class is called in the final stages of
the process for each module, the module parameter is a collection of
objects that represent all of the nodes from the XML that we are
interested in, each object's type is specific for the language construct
(ClassDef, ModuleDef, ParamDef, etc.) and the instance attributes
provide all the details. (These classes are implemented in
http://trac.wxwidgets.org/browser/wxPython/Phoenix/trunk/etgtools/extractors.py)
The bulk of the generator class is simply recursively traversing the
module object collection and writing out appropriate code for each item.

Robin Dunn

unread,
Oct 5, 2011, 6:01:14 PM10/5/11
to wx-...@googlegroups.com
On 10/4/11 6:41 AM, Krishna wrote:
> Hello Robin,

>
> Phoenix looks interesting. Thanks!
>
> Have you looked at SMOKE[1] ? If so, how does it compare to Phoenix?
> The KDE people have been using it to generate complete bindings for
> ruby, perl and php.
>
> cheers,
> --krishna
>
> [1] http://techbase.kde.org/Development/Languages/Smoke
>

No, I haven't seen that one.

Luke A. Guest

unread,
Apr 13, 2012, 8:28:52 AM4/13/12
to wx-...@googlegroups.com, daeta...@gmail.com, ro...@alldunn.com
On Mon, 2011-10-03 at 12:58 +0800, 孙波翔 wrote:
> Hi.
> Thanks for your reply.
> The language is Ada. wxAda was dead. So I want to restart it.
> Sun

Hi, how did I miss this??

Anyway, I'm the original author of wxAda, I still intend on getting this
to work, so it's not completely dead. I have played with the doxygen
output and was building my own tool based on XMLAda, but have just
downloaded the source to Phoenix to look at.

Did you get anywhere or were your completely overwhelmed by the sheer
size of this project?

Luke.


Reply all
Reply to author
Forward
0 new messages