Changed the type of gboolean to a distinct cint.
This commit is contained in:
parent
d23d14897a
commit
317675d5e5
2 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue