diff options
author | Araq <rumpf_a@web.de> | 2011-12-22 15:04:13 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-12-22 15:04:13 +0100 |
commit | f1f458137bf26cfea595eb373388a5f8b71ce4b4 (patch) | |
tree | 1cb6ddbd63635044e98d2607b82afe0326d583ae /lib | |
parent | cd83cc81aa58922e0a8370ae5928d5b5aaa16f84 (diff) | |
parent | 4f08946f64f04ef85a53c686fb89b8d84fbc6d65 (diff) | |
download | Nim-f1f458137bf26cfea595eb373388a5f8b71ce4b4.tar.gz |
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'lib')
-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 |
5 files changed, 21 insertions, 2 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".} |