diff options
-rw-r--r-- | lib/core/locks.nim | 2 | ||||
-rwxr-xr-x | lib/pure/strutils.nim | 10 | ||||
-rwxr-xr-x | lib/windows/shellapi.nim | 2 | ||||
-rwxr-xr-x | lib/wrappers/gtk/glib2.nim | 6 | ||||
-rwxr-xr-x | lib/wrappers/gtk/gtk2.nim | 3 | ||||
-rw-r--r-- | tests/compile/tslurp.nim | 2 |
6 files changed, 22 insertions, 3 deletions
diff --git a/lib/core/locks.nim b/lib/core/locks.nim index 6f139c7a2..6de22ee72 100644 --- a/lib/core/locks.nim +++ b/lib/core/locks.nim @@ -15,7 +15,7 @@ ## to release its locks should it be part of a deadlock. This thread then ## re-acquires its locks and proceeds. -include "lib/system/syslocks" +include "system/syslocks" type TLock* = TSysLock ## Nimrod lock; whether this is re-entrant diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 6b6c3861f..620e6d1c5 100755 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -467,6 +467,16 @@ proc ParseHexInt*(s: string): int {.noSideEffect, procvar, inc(i) of '\0': break else: raise newException(EInvalidValue, "invalid integer: " & s) + +proc parseBool*(s: string): bool = + ## Parses a value into a `bool`. If ``s`` is one of the following values: + ## ``y, yes, true, 1, on``, then returns `true`. If ``s`` is one of the + ## following values: ``n, no, false, 0, off``, then returns `false`. + ## If ``s`` is something else a ``EInvalidValue`` exception is raised. + case normalize(s) + of "y", "yes", "true", "1", "on": result = true + of "n", "no", "false", "0", "off": result = false + else: raise newException(EInvalidValue, "cannot interpret as a bool: " & s) proc repeatChar*(count: int, c: Char = ' '): string {.noSideEffect, rtl, extern: "nsuRepeatChar".} = diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim index 17b16fdbd..da3159176 100755 --- a/lib/windows/shellapi.nim +++ b/lib/windows/shellapi.nim @@ -105,7 +105,7 @@ proc ShellAbout*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon): stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".} proc ShellAbout*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR, HICON: hIcon): int32{. stdcall, dynlib: "shell32.dll", importc: "ShellAboutW".} -proc DuplicateIcon*(hinst: HINST, HICON: hIcon): HIcon{.stdcall, +proc DuplicateIcon*(inst: HINST, icon: HICON): HIcon{.stdcall, dynlib: "shell32.dll", importc: "DuplicateIcon".} proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{. stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".} diff --git a/lib/wrappers/gtk/glib2.nim b/lib/wrappers/gtk/glib2.nim index 9947e2a4b..57d561432 100755 --- a/lib/wrappers/gtk/glib2.nim +++ b/lib/wrappers/gtk/glib2.nim @@ -4507,3 +4507,9 @@ proc g_thread_init*(vtable: pointer) {. proc g_timeout_add*(interval: guint, function, data: gpointer): guint {. cdecl, dynlib: gliblib, importc: "g_timeout_add".} + +proc g_idle_add*(function, data: gpointer): guint {. + cdecl, dynlib: gliblib, importc: "g_idle_add".} + +proc g_source_remove*(tag: guint): gboolean {. + cdecl, dynlib: gliblib, importc: "g_source_remove".} diff --git a/lib/wrappers/gtk/gtk2.nim b/lib/wrappers/gtk/gtk2.nim index 801582cba..e81f1753a 100755 --- a/lib/wrappers/gtk/gtk2.nim +++ b/lib/wrappers/gtk/gtk2.nim @@ -16880,3 +16880,6 @@ proc nimrod_init*() = cmdLine{.importc: "cmdLine".}: array[0..255, cstring] cmdCount{.importc: "cmdCount".}: cint init(addr(cmdLine), addr(cmdCount)) + +proc set_tooltip_text*(w: PWidget, t: cstring){.cdecl, + dynlib: lib, importc: "gtk_widget_set_tooltip_text".} diff --git a/tests/compile/tslurp.nim b/tests/compile/tslurp.nim index c99fefe23..f9456ce6b 100644 --- a/tests/compile/tslurp.nim +++ b/tests/compile/tslurp.nim @@ -1,6 +1,6 @@ const - myRes = slurp"readme.txt" + myRes = slurp"../../readme.txt" echo myRes |