mono / gir-sharp

C# binding generator for GIR format
MIT License
12 stars 10 forks source link

Figure out when a record needs to be generated as a class #59

Open Therzok opened 6 years ago

Therzok commented 6 years ago

There are a few scenarios where plain structs were defined as classes in managed land.

Note in this issue the cases where we need to generate a class instead of a struct for Record:

// Managed then becomes class List { IntPtr native; // Methods which interact with the native pointer.

 // In case we want to provide unsafe access to the native data
 unsafe struct ListInternal
 {
      IntPtr data;
      ListInternal* prev, next;
 }

 public unsafe ListInternal *Native => (ListInternal *)native;

}