mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 03:14:08 +00:00
Changed the type of gboolean to a distinct cint.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import
|
||||
glib2, atk, pango, gdk2pixbuf, gdk2
|
||||
|
||||
export gbool, toBool
|
||||
|
||||
when defined(win32):
|
||||
const
|
||||
lib = "libgtk-win32-2.0-0.dll"
|
||||
|
||||
Reference in New Issue
Block a user