# https://github.com/Araq/wxnim/blob/master/private/object.nim
proc wxCheckDynamicCast*(obj: ptr WxObject; classInfo: ptr WxClassInfo): ptr WxObject {.
cdecl, importcpp: "wxCheckDynamicCast(@)", header: wxh.}
template implement_Dynamic_Class*(n, b: expr): expr =
wxIMPLEMENT_DYNAMIC_CLASS(n, b)
So generally the wx prefix is removed for proc and template names, only if name conflicts with basic Nim symbols exists, prefix is used. But what is the benefit of the underscores _ in template identifiers here?
template wxIS_KIND_OF*(obj, className: expr): expr =
obj.isKindOf(addr(msClassInfo))
template wxIsKindOf*(obj, className: expr): expr =
obj.isKindOf(addr(msClassInfo))
proc wxCheckCast*[T](`ptr`: pointer; a3: ptr T = nil): ptr T {.cdecl,
importcpp: "wxCheckCast(@)", header: wxh.}
template wxStaticCast*(obj, className: expr): expr =
wxCheckCast((obj), cast[ptr ClassName](nil))
Why provide the wxIS_KIND_OF and wxIsKindOf template names for obj.isKindOf(addr(msClassInfo))?
Finally, I found lines like this one in this wrapper:
discard "forward decl of wxColour"
May that be a new secret syntax for something like forward declarations? Did not found it in manual.
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:
#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.