Changed the type of gboolean to a distinct cint.

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

View file

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

View file

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