# test.h #define GTK_TYPE_BIN (gtk_bin_get_type ()) #define GTK_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BIN, GtkBin))
c2nim --nep1 test.h const GTK_TYPE_BIN* = (gtkBinGetType()) template gtk_Bin*(obj: expr): expr = (g_Type_Check_Instance_Cast((obj), gtk_Type_Bin, gtkBin))
c2nim test.h const GTK_TYPE_BIN* = (gtk_bin_get_type()) template GTK_BIN*(obj: expr): expr = (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_BIN, GtkBin))
I considered using the latest c2nim version for prepairing the gtk 3.20 related wrappers because it has bitfield support and is generally a bit smarter. Because for that I would have to fix large parts of my scripts, I considered --nep1 option at the same time. But as you can see nep1 can really generate a lot of problems. gtk_Bin as template name is a bit strange, but that is not a real problem. But GTK_TYPE_BIN as function alias and in the template gtk_Type_Bin symbol for that alias gives some trouble. Of course I can remove the gtk prefix, but the problem would still exist. The output without nep1 is really more nice -- the template name is upper case, but that is not difficult to fix, I did that for the 3.15.xx wrappers.
So we should be really careful with nep1!
typedef enum { /* log flags */ G_LOG_FLAG_RECURSION = 1 << 0, G_LOG_FLAG_FATAL = 1 << 1, /* GLib log levels */ G_LOG_LEVEL_ERROR = 1 << 2, /* always fatal */ G_LOG_LEVEL_CRITICAL = 1 << 3, G_LOG_LEVEL_WARNING = 1 << 4, G_LOG_LEVEL_MESSAGE = 1 << 5, G_LOG_LEVEL_INFO = 1 << 6, G_LOG_LEVEL_DEBUG = 1 << 7, G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL) } GLogLevelFlags; /* GLib log levels that are considered fatal by default */ #define G_LOG_FATAL_MASK (G_LOG_FLAG_RECURSION | G_LOG_LEVEL_ERROR)
type
GLogLevelFlags* = enum
G_LOG_FLAG_RECURSION = 1 shl 0, G_LOG_FLAG_FATAL = 1 shl 1,
G_LOG_LEVEL_ERROR = 1 shl 2, G_LOG_LEVEL_CRITICAL = 1 shl 3,
G_LOG_LEVEL_WARNING = 1 shl 4, G_LOG_LEVEL_MESSAGE = 1 shl 5,
G_LOG_LEVEL_INFO = 1 shl 6, G_LOG_LEVEL_DEBUG = 1 shl 7,
G_LOG_LEVEL_MASK = not (g_Log_Flag_Recursion or g_Log_Flag_Fatal)
const
G_LOG_FATAL_MASK* = (g_Log_Flag_Recursion or g_Log_Level_Error)
c2nim --nep1 --skipcomments --skipinclude ggg.h
Are these 3 empty lines above const intended?