Changed the type of gboolean to a distinct cint.

This commit is contained in:
Dominik Picheta
2013-06-22 19:42:26 +01:00
parent d23d14897a
commit 317675d5e5
2 changed files with 9 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ type
gshort* = cshort
glong* = clong
gint* = cint
gboolean* = bool
gboolean* = distinct gint
guchar* = char
gushort* = int16
gulong* = int
@@ -173,6 +173,12 @@ type
TGBoxedFreeFunc* = proc (boxed: gpointer){.cdecl.}
PGsource = pointer # I don't know and don't care
converter gbool*(nimbool: bool): gboolean =
return ord(nimbool).gboolean
converter toBool*(gbool: gboolean): bool =
return int(gbool) == 1
const
G_TYPE_FUNDAMENTAL_SHIFT* = 2
G_TYPE_FUNDAMENTAL_MAX* = 255 shl G_TYPE_FUNDAMENTAL_SHIFT

View File

@@ -2,6 +2,8 @@
import
glib2, atk, pango, gdk2pixbuf, gdk2
export gbool, toBool
when defined(win32):
const
lib = "libgtk-win32-2.0-0.dll"