On 11/30/2013 09:45 PM, Alexandr Druzninin wrote:
How should I handle opaque structures? For example, I have two c header, clutter-types.h and clutter-color.h. In clutter-color.h ClutterColor structure is defined. And in clutter-types.h there is typedef ClutterColor ClutterColor.
clutter-types.h
...
typedef _ClutterColor ClutterColor;
...clutter-color.h
...
struct _ClutterColor
{
...
}
...I converted .h to .d and now I have:
cluttertypes.d<br>...<br>alias ClutterColor ClutterColor;
...
struct _ClutterColor; // <-- dstep added it
...cluttercolor.d<br>...<br>struct ClutterColor
{
...
}
...I can manually make right aliases, but I'm not sure this is the best way. May be there is more correct way to handle opaque structures? I'm sure Gtk+ bindings solve this problem somehow...
The script/app that generates the bindings for GtkD parses the
documentation. Witch only documents the typedef and it turns it into:
struct ClutterColor{}
A real opaque struct might be better:
struct ClutterColor;