gtkd-developers / gir-to-d

Create D bindings from GObject introspection files
GNU Lesser General Public License v3.0
23 stars 13 forks source link

Always use fully qualified names for imported types #21

Open dhasenan opened 5 years ago

dhasenan commented 5 years ago

I'm trying to create bindings for webkit2gtk and friends. There's a type called Socket in there that wraps a gio Socket. This is a naming conflict currently, but if gir-to-d used qualified names by default, there would be no conflict.

MikeWey commented 5 years ago

gir-to-d should already do this when there is a conflict, ill take a look why it doesn't work for Webkit.

It seems to be working properly for things like gio.Application / gtk.Application.

MikeWey commented 5 years ago

gir-to-d currently only does that for parents that have the same name, but in the case of soup.ClientContext it imports two classes with the same name.

As a workaround you could use this in the lookup definition:

struct: ClientContext
import: gio.Socket : GioSock = Socket
structWrap: Gio.Socket GioSock