[nim-dev] Re: Source code style for wrappers

  • From: Araq <rumpf_a@xxxxxx>
  • To: nim-dev@xxxxxxxxxxxxx
  • Date: Wed, 9 Sep 2015 14:25:05 +0000

wxnim has been translated by c2nim **with no modifications of the generated Nim
code**, so while there still is some cruft as you've noticed, it's getting
better all the time. The switch mostly responsible for what you describe is
``--nep1``. https://github.com/Araq/wxnim/blob/master/headers/wx.c2nim contains
the extensive configuration for c2nim, most interesting is this section:

```C
#nep1
#header wxh
#skipinclude
#skipcomments
#cpp
#assumeifistrue
#cdecl

#discardableprefix Add
#discardableprefix Set
#discardableprefix Show
```

Also for the wx Wrapper I decided to leave the prefixes as they are because I
prefer ``WxButton`` over ``wx.Button``.

Other related posts:

  • » [nim-dev] Re: Source code style for wrappers - Araq