summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-08-31 22:55:51 +0200
committerAraq <rumpf_a@web.de>2014-08-31 22:55:51 +0200
commit41c7cde61f021682899390c550671d93a9bca370 (patch)
tree12967d1de8c0d14a13566031a2d00fcbad4da088
parentd7d059a68695c10b7fe93f8f452d4aceb90857eb (diff)
downloadNim-41c7cde61f021682899390c550671d93a9bca370.tar.gz
updated iup.nim; made tests green
-rw-r--r--compiler/vm.nim4
-rw-r--r--examples/iupex1.nim44
-rw-r--r--examples/sdlex.nim20
-rw-r--r--examples/statcsv.nim6
-rw-r--r--lib/windows/mmsystem.nim591
-rw-r--r--lib/windows/nb30.nim78
-rw-r--r--lib/windows/shellapi.nim246
-rw-r--r--lib/wrappers/iup.nim974
-rw-r--r--lib/wrappers/sdl/sdl.nim162
9 files changed, 1061 insertions, 1064 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index fe2b9c617..5ef4576ec 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -1036,8 +1036,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
       internalError(c.debug[pc], "too implement")
     of opcNarrowS:
       decodeB(rkInt)
-      let min = -(1 shl (rb-1))
-      let max = (1 shl (rb-1))-1
+      let min = -(1.BiggestInt shl (rb-1))
+      let max = (1.BiggestInt shl (rb-1))-1
       if regs[ra].intVal < min or regs[ra].intVal > max:
         stackTrace(c, tos, pc, errGenerated,
           msgKindToString(errUnhandledExceptionX) % "value out of range")
diff --git a/examples/iupex1.nim b/examples/iupex1.nim
index bf7ed2f1c..f768fb23f 100644
--- a/examples/iupex1.nim
+++ b/examples/iupex1.nim
@@ -1,37 +1,37 @@
 # Example IUP program
 
-# IupTabs: Creates a IupTabs control.
+# iupTabs: Creates a iupTabs control.
 
 import iup
 
-discard iup.Open(nil, nil)
+discard iup.open(nil, nil)
 
-var vbox1 = Iup.Vbox(Iup.Label("Inside Tab A"), Iup.Button("Button A", ""), nil)
-var vbox2 = Iup.Vbox(Iup.Label("Inside Tab B"), Iup.Button("Button B", ""), nil)
+var vbox1 = iup.vbox(iup.label("Inside Tab A"), iup.button("Button A", ""), nil)
+var vbox2 = iup.vbox(iup.label("Inside Tab B"), iup.button("Button B", ""), nil)
 
-Iup.SetAttribute(vbox1, "TABTITLE", "Tab A")
-Iup.SetAttribute(vbox2, "TABTITLE", "Tab B")
+iup.setAttribute(vbox1, "TABTITLE", "Tab A")
+iup.setAttribute(vbox2, "TABTITLE", "Tab B")
 
-var tabs1 = Iup.Tabs(vbox1, vbox2, nil)
+var tabs1 = iup.tabs(vbox1, vbox2, nil)
 
-vbox1 = Iup.Vbox(Iup.Label("Inside Tab C"), Iup.Button("Button C", ""), nil)
-vbox2 = Iup.Vbox(Iup.Label("Inside Tab D"), Iup.Button("Button D", ""), nil)
+vbox1 = iup.vbox(iup.label("Inside Tab C"), iup.button("Button C", ""), nil)
+vbox2 = iup.vbox(iup.label("Inside Tab D"), iup.button("Button D", ""), nil)
 
-Iup.SetAttribute(vbox1, "TABTITLE", "Tab C")
-Iup.SetAttribute(vbox2, "TABTITLE", "Tab D")
+iup.setAttribute(vbox1, "TABTITLE", "Tab C")
+iup.setAttribute(vbox2, "TABTITLE", "Tab D")
 
-var tabs2 = Iup.Tabs(vbox1, vbox2, nil)
-Iup.SetAttribute(tabs2, "TABTYPE", "LEFT")
+var tabs2 = iup.tabs(vbox1, vbox2, nil)
+iup.setAttribute(tabs2, "TABTYPE", "LEFT")
 
-var box = Iup.Hbox(tabs1, tabs2, nil)
-Iup.SetAttribute(box, "MARGIN", "10x10")
-Iup.SetAttribute(box, "GAP", "10")
+var box = iup.hbox(tabs1, tabs2, nil)
+iup.setAttribute(box, "MARGIN", "10x10")
+iup.setAttribute(box, "GAP", "10")
 
-var dlg = Iup.Dialog(box)
-Iup.SetAttribute(dlg, "TITLE", "IupTabs")
-Iup.SetAttribute(dlg, "SIZE", "200x100")
+var dlg = iup.dialog(box)
+iup.setAttribute(dlg, "TITLE", "iupTabs")
+iup.setAttribute(dlg, "SIZE", "200x100")
 
-discard ShowXY(dlg, IUP_CENTER, IUP_CENTER)
-discard MainLoop()
-Close()
+discard showXY(dlg, IUP_CENTER, IUP_CENTER)
+discard mainLoop()
+close()
 
diff --git a/examples/sdlex.nim b/examples/sdlex.nim
index 2c1a413e9..665affff8 100644
--- a/examples/sdlex.nim
+++ b/examples/sdlex.nim
@@ -9,21 +9,21 @@ var
   event: TEvent

   bgColor = colChocolate.int32

 

-if init(INIT_VIDEO) != 0:

+if Init(INIT_VIDEO) != 0:

   quit "SDL failed to initialize!"

 

 screen = SetVideoMode(640, 480, 16, SWSURFACE or ANYFORMAT)

 if screen.isNil:

-  quit($sdl.getError())

+  quit($sdl.GetError())

 

 greeting = IMG_load("tux.png")

 if greeting.isNil:

   echo "Failed to load tux.png"

 else:

   ## convert the image to alpha and free the old one

-  var s = greeting.displayFormatAlpha()

+  var s = greeting.DisplayFormatAlpha()

   swap(greeting, s)

-  s.freeSurface()

+  s.FreeSurface()

 

 r.x = 0

 r.y = 0

@@ -31,7 +31,7 @@ r.y = 0
 block game_loop:

   while true:

     

-    while pollEvent(addr event) > 0:

+    while PollEvent(addr event) > 0:

       case event.kind

       of QUITEV:

         break game_loop

@@ -41,12 +41,12 @@ block game_loop:
       else:

         discard

     

-    discard fillRect(screen, nil, bgColor) 

-    discard blitSurface(greeting, nil, screen, addr r)

-    discard flip(screen)

+    discard FillRect(screen, nil, bgColor) 

+    discard BlitSurface(greeting, nil, screen, addr r)

+    discard Flip(screen)

 

-greeting.freeSurface()

-screen.freeSurface()

+greeting.FreeSurface()

+screen.FreeSurface()

 sdl.Quit()

 

 ## fowl wuz here 10/2012
\ No newline at end of file
diff --git a/examples/statcsv.nim b/examples/statcsv.nim
index 48c4ea0cc..cd1de62af 100644
--- a/examples/statcsv.nim
+++ b/examples/statcsv.nim
@@ -8,14 +8,14 @@ import os, streams, parsecsv, strutils, math
 if paramCount() < 1:
   quit("Usage: statcsv filename[.csv]")
 
-var filename = addFileExt(ParamStr(1), "csv")
+var filename = addFileExt(paramStr(1), "csv")
 var s = newFileStream(filename, fmRead)
 if s == nil: quit("cannot open the file " & filename)
 
 var
-  x: TCsvParser
+  x: CsvParser
   header: seq[string]
-  res: seq[TRunningStat]
+  res: seq[RunningStat]
 open(x, s, filename, separator=';', skipInitialSpace = true)
 while readRow(x):
   if processedRows(x) == 1:
diff --git a/lib/windows/mmsystem.nim b/lib/windows/mmsystem.nim
index 632a6e557..45613d8e2 100644
--- a/lib/windows/mmsystem.nim
+++ b/lib/windows/mmsystem.nim
@@ -27,15 +27,15 @@ import
   windows
 
 type
-  MMRESULT* = UINT
-  MMVERSION* = UINT
+  MMRESULT* = uint32
+  MMVERSION* = uint32
   HWAVEOUT* = THandle
   LPHWAVEOUT* = ptr HWAVEOUT
   HWAVEIN* = THandle
   LPHWAVEIN* = ptr HWAVEOUT
   HWAVE* = THandle
   LPHWAVE* = ptr THandle
-  LPUINT* = ptr UINT
+  LPUINT* = ptr uint32
 
 const
   MAXPNAMELEN* = 32
@@ -178,18 +178,18 @@ const
   DRV_MCI_LAST* = (DRV_RESERVED + 0x00000FFF)
 
 type
-  PDRVCALLBACK* = proc (hdrvr: tHandle, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
+  PDRVCALLBACK* = proc (hdrvr: THandle, uMsg: uint32, dwUser, dw1, dw2: DWORD){.
       stdcall.}
 
-proc sndPlaySoundA*(Name: LPCSTR, flags: UINT): BOOL{.stdcall,
+proc sndPlaySoundA*(Name: LPCSTR, flags: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "sndPlaySoundA".}
-proc sndPlaySoundW*(Name: LPCWSTR, flags: UINT): BOOL{.stdcall,
+proc sndPlaySoundW*(Name: LPCWSTR, flags: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "sndPlaySoundW".}
 when defined(winUNICODE):
-  proc sndPlaySound*(Name: cstring, flags: UINT): BOOL{.stdcall,
+  proc sndPlaySound*(Name: cstring, flags: uint32): bool{.stdcall,
       dynlib: "winmm.dll", importc: "sndPlaySoundW".}
 else:
-  proc sndPlaySound*(Name: cstring, flags: UINT): BOOL{.stdcall,
+  proc sndPlaySound*(Name: cstring, flags: uint32): bool{.stdcall,
       dynlib: "winmm.dll", importc: "sndPlaySoundA".}
 const
   SND_NODEFAULT* = 2
@@ -225,12 +225,12 @@ const
   WIM_OPEN* = MM_WIM_OPEN
   WIM_CLOSE* = MM_WIM_CLOSE
   WIM_DATA* = MM_WIM_DATA
-  WAVE_MAPPER* = UINT(- 1)
+  WAVE_MAPPER* = uint32(- 1)
   WAVE_FORMAT_QUERY* = 1
   WAVE_ALLOWSYNC* = 2
   WAVE_MAPPED* = 4
   WAVE_FORMAT_DIRECT* = 8
-  WAVE_FORMAT_DIRECT_QUERY* = (WAVE_FORMAT_QUERY Or WAVE_FORMAT_DIRECT)
+  WAVE_FORMAT_DIRECT_QUERY* = (WAVE_FORMAT_QUERY or WAVE_FORMAT_DIRECT)
   MIM_OPEN* = MM_MIM_OPEN
   MIM_CLOSE* = MM_MIM_CLOSE
   MIM_DATA* = MM_MIM_DATA
@@ -242,7 +242,7 @@ const
   MOM_DONE* = MM_MOM_DONE
   MIM_MOREDATA* = MM_MIM_MOREDATA
   MOM_POSITIONCB* = MM_MOM_POSITIONCB
-  MIDIMAPPER* = UINT(- 1)
+  MIDIMAPPER* = uint32(- 1)
   MIDI_IO_STATUS* = 32
   MIDI_CACHE_ALL* = 1
   MIDI_CACHE_BESTFIT* = 2
@@ -364,53 +364,53 @@ const
   MIXERCONTROL_CT_UNITS_DECIBELS* = 0x00040000
   MIXERCONTROL_CT_UNITS_PERCENT* = 0x00050000
   MIXERCONTROL_CONTROLTYPE_CUSTOM* = (
-    MIXERCONTROL_CT_CLASS_CUSTOM Or MIXERCONTROL_CT_UNITS_CUSTOM)
-  MIXERCONTROL_CONTROLTYPE_BOOLEANMETER* = (MIXERCONTROL_CT_CLASS_METER Or
-      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_BOOLEAN)
-  MIXERCONTROL_CONTROLTYPE_SIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER Or
-      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_SIGNED)
+    MIXERCONTROL_CT_CLASS_CUSTOM or MIXERCONTROL_CT_UNITS_CUSTOM)
+  MIXERCONTROL_CONTROLTYPE_BOOLEANMETER* = (MIXERCONTROL_CT_CLASS_METER or
+      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_SIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER or
+      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_SIGNED)
   MIXERCONTROL_CONTROLTYPE_PEAKMETER* = (
     MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
-  MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER Or
-      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_BOOLEAN* = (MIXERCONTROL_CT_CLASS_SWITCH Or
-      MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER or
+      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_UNSIGNED)
+  MIXERCONTROL_CONTROLTYPE_BOOLEAN* = (MIXERCONTROL_CT_CLASS_SWITCH or
+      MIXERCONTROL_CT_SC_SWITCH_BOOLEAN or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_ONOFF* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
   MIXERCONTROL_CONTROLTYPE_MUTE* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
   MIXERCONTROL_CONTROLTYPE_MONO* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
   MIXERCONTROL_CONTROLTYPE_LOUDNESS* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
   MIXERCONTROL_CONTROLTYPE_STEREOENH* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
-  MIXERCONTROL_CONTROLTYPE_BUTTON* = (MIXERCONTROL_CT_CLASS_SWITCH Or
-      MIXERCONTROL_CT_SC_SWITCH_BUTTON Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_BUTTON* = (MIXERCONTROL_CT_CLASS_SWITCH or
+      MIXERCONTROL_CT_SC_SWITCH_BUTTON or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_DECIBELS* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_DECIBELS)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_DECIBELS)
   MIXERCONTROL_CONTROLTYPE_SIGNED* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_SIGNED)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_SIGNED)
   MIXERCONTROL_CONTROLTYPE_UNSIGNED* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_UNSIGNED)
   MIXERCONTROL_CONTROLTYPE_PERCENT* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_PERCENT)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_PERCENT)
   MIXERCONTROL_CONTROLTYPE_SLIDER* = (
-    MIXERCONTROL_CT_CLASS_SLIDER Or MIXERCONTROL_CT_UNITS_SIGNED)
+    MIXERCONTROL_CT_CLASS_SLIDER or MIXERCONTROL_CT_UNITS_SIGNED)
   MIXERCONTROL_CONTROLTYPE_PAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
   MIXERCONTROL_CONTROLTYPE_QSOUNDPAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
   MIXERCONTROL_CONTROLTYPE_FADER* = (
-    MIXERCONTROL_CT_CLASS_FADER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
+    MIXERCONTROL_CT_CLASS_FADER or MIXERCONTROL_CT_UNITS_UNSIGNED)
   MIXERCONTROL_CONTROLTYPE_VOLUME* = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
   MIXERCONTROL_CONTROLTYPE_BASS* = (MIXERCONTROL_CONTROLTYPE_FADER + 2)
   MIXERCONTROL_CONTROLTYPE_TREBLE* = (MIXERCONTROL_CONTROLTYPE_FADER + 3)
   MIXERCONTROL_CONTROLTYPE_EQUALIZER* = (MIXERCONTROL_CONTROLTYPE_FADER + 4)
-  MIXERCONTROL_CONTROLTYPE_SINGLESELECT* = (MIXERCONTROL_CT_CLASS_LIST Or
-      MIXERCONTROL_CT_SC_LIST_SINGLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_SINGLESELECT* = (MIXERCONTROL_CT_CLASS_LIST or
+      MIXERCONTROL_CT_SC_LIST_SINGLE or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_MUX* = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
-  MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT* = (MIXERCONTROL_CT_CLASS_LIST Or
-      MIXERCONTROL_CT_SC_LIST_MULTIPLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT* = (MIXERCONTROL_CT_CLASS_LIST or
+      MIXERCONTROL_CT_SC_LIST_MULTIPLE or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_MIXER* = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT +
       1)
-  MIXERCONTROL_CONTROLTYPE_MICROTIME* = (MIXERCONTROL_CT_CLASS_TIME Or
-      MIXERCONTROL_CT_SC_TIME_MICROSECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_MILLITIME* = (MIXERCONTROL_CT_CLASS_TIME Or
-      MIXERCONTROL_CT_SC_TIME_MILLISECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
+  MIXERCONTROL_CONTROLTYPE_MICROTIME* = (MIXERCONTROL_CT_CLASS_TIME or
+      MIXERCONTROL_CT_SC_TIME_MICROSECS or MIXERCONTROL_CT_UNITS_UNSIGNED)
+  MIXERCONTROL_CONTROLTYPE_MILLITIME* = (MIXERCONTROL_CT_CLASS_TIME or
+      MIXERCONTROL_CT_SC_TIME_MILLISECS or MIXERCONTROL_CT_UNITS_UNSIGNED)
   MIXER_SHORT_NAME_CHARS* = 16
   MIXER_LONG_NAME_CHARS* = 64
   MIXERR_INVALLINE* = (MIXERR_BASE + 0)
@@ -419,15 +419,15 @@ const
   MIXERR_LASTERROR* = (MIXERR_BASE + 2)
   MIXER_OBJECTF_HANDLE* = 0x80000000
   MIXER_OBJECTF_MIXER* = 0
-  MIXER_OBJECTF_HMIXER* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)
+  MIXER_OBJECTF_HMIXER* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIXER)
   MIXER_OBJECTF_WAVEOUT* = 0x10000000
-  MIXER_OBJECTF_HWAVEOUT* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)
+  MIXER_OBJECTF_HWAVEOUT* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEOUT)
   MIXER_OBJECTF_WAVEIN* = 0x20000000
-  MIXER_OBJECTF_HWAVEIN* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)
+  MIXER_OBJECTF_HWAVEIN* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEIN)
   MIXER_OBJECTF_MIDIOUT* = 0x30000000
-  MIXER_OBJECTF_HMIDIOUT* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)
+  MIXER_OBJECTF_HMIDIOUT* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIOUT)
   MIXER_OBJECTF_MIDIIN* = 0x40000000
-  MIXER_OBJECTF_HMIDIIN* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIIN)
+  MIXER_OBJECTF_HMIDIIN* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)
   MIXER_OBJECTF_AUX* = 0x50000000
   MIXER_GETCONTROLDETAILSF_VALUE* = 0
   MIXER_GETCONTROLDETAILSF_LISTTEXT* = 1
@@ -492,8 +492,8 @@ const
   JOY_RETURNPOVCTS* = 512
   JOY_RETURNCENTERED* = 0x00000400
   JOY_USEDEADZONE* = 0x00000800
-  JOY_RETURNALL* = (JOY_RETURNX Or JOY_RETURNY Or JOY_RETURNZ Or JOY_RETURNR Or
-      JOY_RETURNU Or JOY_RETURNV Or JOY_RETURNPOV Or JOY_RETURNBUTTONS)
+  JOY_RETURNALL* = (JOY_RETURNX or JOY_RETURNY or JOY_RETURNZ or JOY_RETURNR or
+      JOY_RETURNU or JOY_RETURNV or JOY_RETURNPOV or JOY_RETURNBUTTONS)
   JOY_CAL_READALWAYS* = 0x00010000
   JOY_CAL_READXYONLY* = 0x00020000
   JOY_CAL_READ3* = 0x00040000
@@ -982,17 +982,17 @@ const
                         #/////////////////////////////////////////////////////////
 
 type
-  mmtime* {.final.} = object
-    wType*: UINT
+  MMTIME* {.final.} = object
+    wType*: uint32
     hour*, min*, sec*, frame*, fps*, dummy*: int8
     pad*: array[0..1, int8]
 
-  PMMTIME* = ptr mmtime
-  NPMMTIME* = ptr mmtime
-  LPMMTIME* = ptr mmtime
-  PWAVEHDR* = ptr wavehdr
-  TMMTime* = mmtime
-  wavehdr* {.final.} = object
+  PMMTIME* = ptr MMTIME
+  NPMMTIME* = ptr MMTIME
+  LPMMTIME* = ptr MMTIME
+  PWAVEHDR* = ptr WAVEHDR
+  TMMTime* = MMTIME
+  WAVEHDR* {.final.} = object
     lpData*: cstring
     dwBufferLength*: DWORD
     dwBytesRecorded*: DWORD
@@ -1003,13 +1003,13 @@ type
     reserved*: DWORD
 
   TWAVEHDR* = WAVEHDR
-  NPWAVEHDR* = ptr wavehdr
-  LPWAVEHDR* = ptr wavehdr
+  NPWAVEHDR* = ptr WAVEHDR
+  LPWAVEHDR* = ptr WAVEHDR
   WAVEOUTCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1023,7 +1023,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1052,7 +1052,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1065,7 +1065,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1089,29 +1089,29 @@ else:
     LPWAVEINCAPS* = LPWAVEINCAPSA
 type
   TWAVEINCAPS* = WAVEINCAPS
-  waveformat* {.final.} = object
+  WAVEFORMAT* {.final.} = object
     wFormatTag*: int16
     nChannels*: int16
     nSamplesPerSec*: DWORD
     nAvgBytesPerSec*: DWORD
     nBlockAlign*: int16
 
-  PWAVEFORMAT* = ptr waveformat
-  NPWAVEFORMAT* = ptr waveformat
-  LPWAVEFORMAT* = ptr waveformat
-  TWAVEFORMAT* = waveformat
+  PWAVEFORMAT* = ptr WAVEFORMAT
+  NPWAVEFORMAT* = ptr WAVEFORMAT
+  LPWAVEFORMAT* = ptr WAVEFORMAT
+  TWAVEFORMAT* = WAVEFORMAT
 
 const
   WAVE_FORMAT_PCM* = 1
 
 type
-  pcmwaveformat* {.final.} = object
+  PCMWAVEFORMAT* {.final.} = object
     wf*: WAVEFORMAT
     wBitsPerSample*: int16
 
-  PPCMWAVEFORMAT* = ptr pcmwaveformat
-  NPPCMWAVEFORMAT* = ptr pcmwaveformat
-  LPPCMWAVEFORMAT* = ptr pcmwaveformat
+  PPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
+  NPPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
+  LPPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
   TPCMWAVEFORMAT* = PCMWAVEFORMAT
   WAVEFORMATEX* {.final.} = object
     wFormatTag*: int16
@@ -1141,15 +1141,15 @@ const
   MIDIPATCHSIZE* = 128
 
 type
-  PATCHARRAY* = array[0..Pred(MIDIPATCHSIZE), int16]
+  PATCHARRAY* = array[0..pred(MIDIPATCHSIZE), int16]
   LPPATCHARRAY* = ptr int16
-  KEYARRAY* = array[0..Pred(MIDIPATCHSIZE), int16]
+  KEYARRAY* = array[0..pred(MIDIPATCHSIZE), int16]
   LPKEYARRAY* = ptr int16
   MIDIOUTCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     wTechnology*: int16
     wVoices*: int16
     wNotes*: int16
@@ -1164,7 +1164,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     wTechnology*: int16
     wVoices*: int16
     wNotes*: int16
@@ -1179,7 +1179,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     dwSupport*: DWORD
 
   PMIDIINCAPSA* = ptr MIDIINCAPSA
@@ -1190,7 +1190,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     dwSupport*: DWORD
 
   PMIDIINCAPSW* = ptr MIDIINCAPSW
@@ -1220,8 +1220,8 @@ else:
     LPMIDIINCAPS* = LPMIDIINCAPSA
 type
   TMIDIINCAPS* = MIDIINCAPS
-  PMIDIHDR* = ptr midihdr
-  midihdr* {.final.} = object
+  PMIDIHDR* = ptr MIDIHDR
+  MIDIHDR* {.final.} = object
     lpData*: cstring
     dwBufferLength*: DWORD
     dwBytesRecorded*: DWORD
@@ -1230,19 +1230,19 @@ type
     lpNext*: PMIDIHDR
     reserved*: DWORD
     dwOffset*: DWORD
-    dwReserved*: array[0..Pred(8), DWORD]
+    dwReserved*: array[0..pred(8), DWORD]
 
-  NPMIDIHDR* = ptr midihdr
-  LPMIDIHDR* = ptr midihdr
+  NPMIDIHDR* = ptr MIDIHDR
+  LPMIDIHDR* = ptr MIDIHDR
   TMIDIHDR* = MIDIHDR
-  midievent* {.final.} = object
+  MIDIEVENT* {.final.} = object
     dwDeltaTime*: DWORD
     dwStreamID*: DWORD
     dwEvent*: DWORD
-    dwParms*: array[0..Pred(1), DWORD]
+    dwParms*: array[0..pred(1), DWORD]
 
   TMIDIEVENT* = MIDIEVENT
-  midistrmbuffver* {.final.} = object
+  MIDISTRMBUFFVER* {.final.} = object
     dwVersion*: DWORD
     dwMid*: DWORD
     dwOEMVersion*: DWORD
@@ -1262,7 +1262,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     wTechnology*: int16
     wReserved1*: int16
     dwSupport*: DWORD
@@ -1275,7 +1275,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     wTechnology*: int16
     wReserved1*: int16
     dwSupport*: DWORD
@@ -1304,14 +1304,14 @@ type
   HMIXER* = THandle
   LPHMIXER* = ptr HMIXER
 
-proc mixerGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc mixerGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                importc: "mixerGetNumDevs".}
 type
   MIXERCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     fdwSupport*: DWORD
     cDestinations*: DWORD
 
@@ -1322,7 +1322,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     fdwSupport*: DWORD
     cDestinations*: DWORD
 
@@ -1353,12 +1353,12 @@ type
     cChannels*: DWORD
     cConnections*: DWORD
     cControls*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), char]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
     dwType*, dwDeviceID*: DWORD
     wMid*, wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), Char]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
 
   PMIXERLINEA* = ptr MIXERLINEA
   LPMIXERLINEA* = ptr MIXERLINEA
@@ -1374,8 +1374,8 @@ type
     cChannels*: DWORD
     cConnections*: DWORD
     cControls*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), WCHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
     dwType*, dwDeviceID*: DWORD
     wMid*, wPid*: int16
     vDriverVersion*: MMVERSION
@@ -1403,8 +1403,8 @@ type
     dwControlType*: DWORD
     fdwControl*: DWORD
     cMultipleItems*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), char]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
     dwMinimum*, dwMaximum*: DWORD
     dwReserved*: array[0..3, DWORD]
     cSteps*: DWORD
@@ -1419,8 +1419,8 @@ type
     dwControlType*: DWORD
     fdwControl*: DWORD
     cMultipleItems*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), WCHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
     dwMinimum*, dwMaximum*: DWORD
     dwReserved*: array[0..3, DWORD]
     cSteps*: DWORD
@@ -1478,15 +1478,15 @@ type
     dwControlID*: DWORD
     cChannels*: DWORD
     cMultipleItems*, cbDetails*: DWORD
-    paDetails*: Pointer
+    paDetails*: pointer
 
-  MIXERCONTROLDETAILS* = tMIXERCONTROLDETAILS
-  PMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
-  LPMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
+  MIXERCONTROLDETAILS* = TMIXERCONTROLDETAILS
+  PMIXERCONTROLDETAILS* = ptr TMIXERCONTROLDETAILS
+  LPMIXERCONTROLDETAILS* = ptr TMIXERCONTROLDETAILS
   MIXERCONTROLDETAILS_LISTTEXTA* {.final.} = object
     dwParam1*: DWORD
     dwParam2*: DWORD
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
 
   PMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
   LPMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
@@ -1494,7 +1494,7 @@ type
   MIXERCONTROLDETAILS_LISTTEXTW* {.final.} = object
     dwParam1*: DWORD
     dwParam2*: DWORD
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
 
   PMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
   LPMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
@@ -1530,42 +1530,42 @@ type
   PMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
   LPMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
   TMIXERCONTROLDETAILS_UNSIGNED* = MIXERCONTROLDETAILS_UNSIGNED
-  LPTIMECALLBACK* = proc (uTimerID, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
+  LPTIMECALLBACK* = proc (uTimerID, uMsg: uint32, dwUser, dw1, dw2: DWORD){.
       stdcall.}
   TTIMECALLBACK* = LPTIMECALLBACK
-  timecaps* {.final.} = object
-    wPeriodMin*: UINT
-    wPeriodMax*: UINT
+  TIMECAPS* {.final.} = object
+    wPeriodMin*: uint32
+    wPeriodMax*: uint32
 
-  PTIMECAPS* = ptr timecaps
-  NPTIMECAPS* = ptr timecaps
-  LPTIMECAPS* = ptr timecaps
+  PTIMECAPS* = ptr TIMECAPS
+  NPTIMECAPS* = ptr TIMECAPS
+  LPTIMECAPS* = ptr TIMECAPS
   TTIMECAS* = TIMECAPS
   JOYCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
-    wXmin*: UINT
-    wXmax*: UINT
-    wYmin*: UINT
-    wYmax*: UINT
-    wZmin*: UINT
-    wZmax*: UINT
-    wNumButtons*: UINT
-    wPeriodMin*: UINT
-    wPeriodMax*: UINT
-    wRmin*: UINT
-    wRmax*: UINT
-    wUmin*: UINT
-    wUmax*: UINT
-    wVmin*: UINT
-    wVmax*: UINT
-    wCaps*: UINT
-    wMaxAxes*: UINT
-    wNumAxes*: UINT
-    wMaxButtons*: UINT
-    szRegKey*: array[0..Pred(MAXPNAMELEN), CHAR]
-    szOEMVxD*: array[0..Pred(MAX_JOYSTICKOEMVXDNAME), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
+    wXmin*: uint32
+    wXmax*: uint32
+    wYmin*: uint32
+    wYmax*: uint32
+    wZmin*: uint32
+    wZmax*: uint32
+    wNumButtons*: uint32
+    wPeriodMin*: uint32
+    wPeriodMax*: uint32
+    wRmin*: uint32
+    wRmax*: uint32
+    wUmin*: uint32
+    wUmax*: uint32
+    wVmin*: uint32
+    wVmax*: uint32
+    wCaps*: uint32
+    wMaxAxes*: uint32
+    wNumAxes*: uint32
+    wMaxButtons*: uint32
+    szRegKey*: array[0..pred(MAXPNAMELEN), char]
+    szOEMVxD*: array[0..pred(MAX_JOYSTICKOEMVXDNAME), char]
 
   PJOYCAPSA* = ptr JOYCAPSA
   NPJOYCAPSA* = ptr JOYCAPSA
@@ -1574,28 +1574,28 @@ type
   JOYCAPSW* {.final.} = object
     wMid*: int16
     wPid*: int16
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
-    wXmin*: UINT
-    wXmax*: UINT
-    wYmin*: UINT
-    wYmax*: UINT
-    wZmin*: UINT
-    wZmax*: UINT
-    wNumButtons*: UINT
-    wPeriodMin*: UINT
-    wPeriodMax*: UINT
-    wRmin*: UINT
-    wRmax*: UINT
-    wUmin*: UINT
-    wUmax*: UINT
-    wVmin*: UINT
-    wVmax*: UINT
-    wCaps*: UINT
-    wMaxAxes*: UINT
-    wNumAxes*: UINT
-    wMaxButtons*: UINT
-    szRegKey*: array[0..Pred(MAXPNAMELEN), WCHAR]
-    szOEMVxD*: array[0..Pred(MAX_JOYSTICKOEMVXDNAME), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
+    wXmin*: uint32
+    wXmax*: uint32
+    wYmin*: uint32
+    wYmax*: uint32
+    wZmin*: uint32
+    wZmax*: uint32
+    wNumButtons*: uint32
+    wPeriodMin*: uint32
+    wPeriodMax*: uint32
+    wRmin*: uint32
+    wRmax*: uint32
+    wUmin*: uint32
+    wUmax*: uint32
+    wVmin*: uint32
+    wVmax*: uint32
+    wCaps*: uint32
+    wMaxAxes*: uint32
+    wNumAxes*: uint32
+    wMaxButtons*: uint32
+    szRegKey*: array[0..pred(MAXPNAMELEN), WCHAR]
+    szOEMVxD*: array[0..pred(MAX_JOYSTICKOEMVXDNAME), WCHAR]
 
   PJOYCAPSW* = ptr JOYCAPSW
   NPJOYCAPSW* = ptr JOYCAPSW
@@ -1616,45 +1616,45 @@ else:
     LPJOYCAPS* = LPJOYCAPSA
 type
   TJOYCAPS* = JOYCAPS
-  joyinfo* {.final.} = object
-    wXpos*: UINT
-    wYpos*: UINT
-    wZpos*: UINT
-    wButtons*: UINT
-
-  PJOYINFO* = ptr joyinfo
-  NPJOYINFO* = ptr joyinfo
-  LPJOYINFO* = ptr joyinfo
+  JOYINFO* {.final.} = object
+    wXpos*: uint32
+    wYpos*: uint32
+    wZpos*: uint32
+    wButtons*: uint32
+
+  PJOYINFO* = ptr JOYINFO
+  NPJOYINFO* = ptr JOYINFO
+  LPJOYINFO* = ptr JOYINFO
   TJOYINFO* = JOYINFO
-  joyinfoex* {.final.} = object
+  JOYINFOEX* {.final.} = object
     dwSize*: DWORD
     dwFlags*: DWORD
-    wXpos*: UINT
-    wYpos*: UINT
-    wZpos*: UINT
+    wXpos*: uint32
+    wYpos*: uint32
+    wZpos*: uint32
     dwRpos*: DWORD
     dwUpos*: DWORD
     dwVpos*: DWORD
-    wButtons*: UINT
+    wButtons*: uint32
     dwButtonNumber*: DWORD
     dwPOV*: DWORD
     dwReserved1*: DWORD
     dwReserved2*: DWORD
 
-  PJOYINFOEX* = ptr joyinfoex
-  NPJOYINFOEX* = ptr joyinfoex
-  LPJOYINFOEX* = ptr joyinfoex
+  PJOYINFOEX* = ptr JOYINFOEX
+  NPJOYINFOEX* = ptr JOYINFOEX
+  LPJOYINFOEX* = ptr JOYINFOEX
   TJOYINFOEX* = JOYINFOEX
   FOURCC* = DWORD
   HPSTR* = cstring
   HMMIO* = THandle
-  LPMMIOPROC* = proc (x1: LPSTR, x2: UINT, x3, x4: LPARAM): LRESULT{.stdcall.}
+  LPMMIOPROC* = proc (x1: LPSTR, x2: uint32, x3, x4: LPARAM): LRESULT{.stdcall.}
   TMMIOPROC* = LPMMIOPROC
   MMIOINFO* {.final.} = object
     dwFlags*: DWORD
     fccIOProc*: FOURCC
     pIOProc*: LPMMIOPROC
-    wErrorRet*: UINT
+    wErrorRet*: uint32
     htask*: HTASK
     cchBuffer*: int32
     pchBuffer*: HPSTR
@@ -1663,7 +1663,7 @@ type
     pchEndWrite*: HPSTR
     lBufOffset*: int32
     lDiskOffset*: int32
-    adwInfo*: array[0..Pred(3), DWORD]
+    adwInfo*: array[0..pred(3), DWORD]
     dwReserved1*: DWORD
     dwReserved2*: DWORD
     hmmio*: HMMIO
@@ -1686,8 +1686,8 @@ type
   LPCMMCKINFO* = ptr MMCKINFO
   TMMCKINFO* = MMCKINFO
   MCIERROR* = DWORD
-  MCIDEVICEID* = UINT
-  YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): UINT{.stdcall.}
+  MCIDEVICEID* = uint32
+  YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): uint32{.stdcall.}
   TYIELDPROC* = YIELDPROC
   MCI_GENERIC_PARMS* {.final.} = object
     dwCallback*: DWORD
@@ -1790,7 +1790,7 @@ type
     lpstrReturn*: cstring
     dwRetSize*: DWORD
     dwNumber*: DWORD
-    wDeviceType*: UINT
+    wDeviceType*: uint32
 
   PMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
   LPMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
@@ -1800,7 +1800,7 @@ type
     lpstrReturn*: LPWSTR
     dwRetSize*: DWORD
     dwNumber*: DWORD
-    wDeviceType*: UINT
+    wDeviceType*: uint32
 
   PMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
   LPMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
@@ -1984,8 +1984,8 @@ type
     dwCallback*: DWORD
     dwTimeFormat*: DWORD
     dwAudio*: DWORD
-    wInput*: UINT
-    wOutput*: UINT
+    wInput*: uint32
+    wOutput*: uint32
     wFormatTag*: int16
     wReserved2*: int16
     nChannels*: int16
@@ -2052,7 +2052,7 @@ type
   MCI_ANIM_WINDOW_PARMSW* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCWSTR
 
   PMCI_ANIM_WINDOW_PARMSW* = ptr MCI_ANIM_WINDOW_PARMSW
@@ -2068,7 +2068,7 @@ type
   MCI_ANIM_WINDOW_PARMSA* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCSTR
 
   PMCI_ANIM_WINDOW_PARMSA* = ptr MCI_ANIM_WINDOW_PARMSA
@@ -2149,7 +2149,7 @@ type
   MCI_OVLY_WINDOW_PARMSA* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCSTR
 
   PMCI_OVLY_WINDOW_PARMSA* = ptr MCI_OVLY_WINDOW_PARMSA
@@ -2158,7 +2158,7 @@ type
   MCI_OVLY_WINDOW_PARMSW* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCWSTR
 
   PMCI_OVLY_WINDOW_PARMSW* = ptr MCI_OVLY_WINDOW_PARMSW
@@ -2243,14 +2243,11 @@ else:
 type
   TMCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMS
 
-type
-  pcmwaveformat_tag* = PCMWAVEFORMAT
-
-proc mmioStringToFOURCCA*(x1: LPCSTR, x2: UINT): FOURCC{.stdcall,
+proc mmioStringToFOURCCA*(x1: LPCSTR, x2: uint32): FOURCC{.stdcall,
     dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
-proc mmioStringToFOURCCW*(x1: LPCWSTR, x2: UINT): FOURCC{.stdcall,
+proc mmioStringToFOURCCW*(x1: LPCWSTR, x2: uint32): FOURCC{.stdcall,
     dynlib: "winmm.dll", importc: "mmioStringToFOURCCW".}
-proc mmioStringToFOURCC*(x1: cstring, x2: UINT): FOURCC{.stdcall,
+proc mmioStringToFOURCC*(x1: cstring, x2: uint32): FOURCC{.stdcall,
     dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
 proc mmioInstallIOProcA*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
     stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcA".}
@@ -2270,7 +2267,7 @@ proc mmioRenameW*(x1: LPCWSTR, x2: LPCWSTR, x3: LPCMMIOINFO, x4: DWORD): MMRESUL
     stdcall, dynlib: "winmm.dll", importc: "mmioRenameW".}
 proc mmioRename*(x1: cstring, x2: cstring, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioRenameA".}
-proc mmioClose*(x1: HMMIO, x2: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc mmioClose*(x1: HMMIO, x2: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "mmioClose".}
 proc mmioRead*(x1: HMMIO, x2: HPSTR, x3: LONG): LONG{.stdcall,
     dynlib: "winmm.dll", importc: "mmioRead".}
@@ -2278,35 +2275,35 @@ proc mmioWrite*(x1: HMMIO, x2: cstring, x3: LONG): LONG{.stdcall,
     dynlib: "winmm.dll", importc: "mmioWrite".}
 proc mmioSeek*(x1: HMMIO, x2: LONG, x3: WINT): LONG{.stdcall,
     dynlib: "winmm.dll", importc: "mmioSeek".}
-proc mmioGetInfo*(x1: HMMIO, x2: LPMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioGetInfo*(x1: HMMIO, x2: LPMMIOINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioGetInfo".}
-proc mmioSetInfo*(x1: HMMIO, x2: LPCMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioSetInfo*(x1: HMMIO, x2: LPCMMIOINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioSetInfo".}
-proc mmioSetBuffer*(x1: HMMIO, x2: LPSTR, x3: LONG, x4: UINT): MMRESULT{.
+proc mmioSetBuffer*(x1: HMMIO, x2: LPSTR, x3: LONG, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioSetBuffer".}
-proc mmioFlush*(x1: HMMIO, x2: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc mmioFlush*(x1: HMMIO, x2: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "mmioFlush".}
-proc mmioAdvance*(x1: HMMIO, x2: LPMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioAdvance*(x1: HMMIO, x2: LPMMIOINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioAdvance".}
-proc mmioSendMessage*(x1: HMMIO, x2: UINT, x3: LPARAM, x4: LPARAM): LRESULT{.
+proc mmioSendMessage*(x1: HMMIO, x2: uint32, x3: LPARAM, x4: LPARAM): LRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioSendMessage".}
-proc mmioDescend*(x1: HMMIO, x2: LPMMCKINFO, x3: PMMCKINFO, x4: UINT): MMRESULT{.
+proc mmioDescend*(x1: HMMIO, x2: LPMMCKINFO, x3: PMMCKINFO, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioDescend".}
-proc mmioAscend*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioAscend*(x1: HMMIO, x2: LPMMCKINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioAscend".}
-proc mmioCreateChunk*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioCreateChunk*(x1: HMMIO, x2: LPMMCKINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioCreateChunk".}
-proc mciSendCommandA*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+proc mciSendCommandA*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
-proc mciSendCommandW*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+proc mciSendCommandW*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendCommandW".}
-proc mciSendCommand*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+proc mciSendCommand*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
-proc mciSendStringA*(x1: LPCSTR, x2: LPSTR, x3: UINT, x4: HWND): MCIERROR{.
+proc mciSendStringA*(x1: LPCSTR, x2: LPSTR, x3: uint32, x4: HWND): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
-proc mciSendStringW*(x1: LPCWSTR, x2: LPWSTR, x3: UINT, x4: HWND): MCIERROR{.
+proc mciSendStringW*(x1: LPCWSTR, x2: LPWSTR, x3: uint32, x4: HWND): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendStringW".}
-proc mciSendString*(x1: cstring, x2: cstring, x3: UINT, x4: HWND): MCIERROR{.
+proc mciSendString*(x1: cstring, x2: cstring, x3: uint32, x4: HWND): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
 proc mciGetDeviceIDA*(x1: LPCSTR): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
     importc: "mciGetDeviceIDA".}
@@ -2320,60 +2317,60 @@ proc mciGetDeviceIDFromElementIDW*(x1: DWORD, x2: LPCWSTR): MCIDEVICEID{.
     stdcall, dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDW".}
 proc mciGetDeviceIDFromElementID*(x1: DWORD, x2: cstring): MCIDEVICEID{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDA".}
-proc mciGetErrorStringA*(x1: MCIERROR, x2: LPSTR, x3: UINT): BOOL{.stdcall,
+proc mciGetErrorStringA*(x1: MCIERROR, x2: LPSTR, x3: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
-proc mciGetErrorStringW*(x1: MCIERROR, x2: LPWSTR, x3: UINT): BOOL{.stdcall,
+proc mciGetErrorStringW*(x1: MCIERROR, x2: LPWSTR, x3: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetErrorStringW".}
-proc mciGetErrorString*(x1: MCIERROR, x2: cstring, x3: UINT): BOOL{.stdcall,
+proc mciGetErrorString*(x1: MCIERROR, x2: cstring, x3: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
-proc mciSetYieldProc*(x1: MCIDEVICEID, x2: YIELDPROC, x3: DWORD): BOOL{.stdcall,
+proc mciSetYieldProc*(x1: MCIDEVICEID, x2: YIELDPROC, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciSetYieldProc".}
 proc mciGetCreatorTask*(x1: MCIDEVICEID): HTASK{.stdcall, dynlib: "winmm.dll",
     importc: "mciGetCreatorTask".}
 proc mciGetYieldProc*(x1: MCIDEVICEID, x2: LPDWORD): YIELDPROC{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetYieldProc".}
-proc mciExecute*(x1: LPCSTR): BOOL{.stdcall, dynlib: "winmm.dll",
+proc mciExecute*(x1: LPCSTR): bool{.stdcall, dynlib: "winmm.dll",
                                     importc: "mciExecute".}
-proc joyGetPos*(x1: UINT, x2: LPJOYINFO): MMRESULT{.stdcall,
+proc joyGetPos*(x1: uint32, x2: LPJOYINFO): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetPos".}
-proc joyGetPosEx*(x1: UINT, x2: LPJOYINFOEX): MMRESULT{.stdcall,
+proc joyGetPosEx*(x1: uint32, x2: LPJOYINFOEX): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetPosEx".}
-proc joyGetThreshold*(x1: UINT, x2: LPUINT): MMRESULT{.stdcall,
+proc joyGetThreshold*(x1: uint32, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetThreshold".}
-proc joyReleaseCapture*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc joyReleaseCapture*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "joyReleaseCapture".}
-proc joySetCapture*(x1: HWND, x2: UINT, x3: UINT, x4: BOOL): MMRESULT{.stdcall,
+proc joySetCapture*(x1: HWND, x2: uint32, x3: uint32, x4: bool): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joySetCapture".}
-proc joySetThreshold*(x1: UINT, x2: UINT): MMRESULT{.stdcall,
+proc joySetThreshold*(x1: uint32, x2: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joySetThreshold".}
-proc waveOutGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc waveOutGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                  importc: "waveOutGetNumDevs".}
-proc waveOutGetDevCapsA*(x1: UINT, x2: LPWAVEOUTCAPSA, x3: UINT): MMRESULT{.
+proc waveOutGetDevCapsA*(x1: uint32, x2: LPWAVEOUTCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
-proc waveOutGetDevCapsW*(x1: UINT, x2: LPWAVEOUTCAPSW, x3: UINT): MMRESULT{.
+proc waveOutGetDevCapsW*(x1: uint32, x2: LPWAVEOUTCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsW".}
-proc waveOutGetDevCaps*(x1: UINT, x2: LPWAVEOUTCAPS, x3: UINT): MMRESULT{.
+proc waveOutGetDevCaps*(x1: uint32, x2: LPWAVEOUTCAPS, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
 proc waveOutGetVolume*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutGetVolume".}
 proc waveOutSetVolume*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutSetVolume".}
-proc waveOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.
+proc waveOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
-proc waveOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc waveOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextW".}
-proc waveOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc waveOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
-proc waveOutOpen*(x1: LPHWAVEOUT, x2: UINT, x3: LPCWAVEFORMATEX, x4: DWORD,
+proc waveOutOpen*(x1: LPHWAVEOUT, x2: uint32, x3: LPCWAVEFORMATEX, x4: DWORD,
                   x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutOpen".}
 proc waveOutClose*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutClose".}
-proc waveOutPrepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveOutPrepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutPrepareHeader".}
-proc waveOutUnprepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveOutUnprepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutUnprepareHeader".}
-proc waveOutWrite*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.stdcall,
+proc waveOutWrite*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutWrite".}
 proc waveOutPause*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutPause".}
@@ -2383,7 +2380,7 @@ proc waveOutReset*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutReset".}
 proc waveOutBreakLoop*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutBreakLoop".}
-proc waveOutGetPosition*(x1: HWAVEOUT, x2: LPMMTIME, x3: UINT): MMRESULT{.
+proc waveOutGetPosition*(x1: HWAVEOUT, x2: LPMMTIME, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetPosition".}
 proc waveOutGetPitch*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutGetPitch".}
@@ -2395,32 +2392,32 @@ proc waveOutSetPlaybackRate*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutSetPlaybackRate".}
 proc waveOutGetID*(x1: HWAVEOUT, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutGetID".}
-proc waveOutMessage*(x1: HWAVEOUT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc waveOutMessage*(x1: HWAVEOUT, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutMessage".}
-proc waveInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc waveInGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                 importc: "waveInGetNumDevs".}
-proc waveInGetDevCapsA*(x1: UINT, x2: LPWAVEINCAPSA, x3: UINT): MMRESULT{.
+proc waveInGetDevCapsA*(x1: uint32, x2: LPWAVEINCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
-proc waveInGetDevCapsW*(x1: UINT, x2: LPWAVEINCAPSW, x3: UINT): MMRESULT{.
+proc waveInGetDevCapsW*(x1: uint32, x2: LPWAVEINCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsW".}
-proc waveInGetDevCaps*(x1: UINT, x2: LPWAVEINCAPS, x3: UINT): MMRESULT{.stdcall,
+proc waveInGetDevCaps*(x1: uint32, x2: LPWAVEINCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
-proc waveInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
+proc waveInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
-proc waveInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc waveInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextW".}
-proc waveInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc waveInGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
-proc waveInOpen*(x1: LPHWAVEIN, x2: UINT, x3: LPCWAVEFORMATEX, x4: DWORD,
+proc waveInOpen*(x1: LPHWAVEIN, x2: uint32, x3: LPCWAVEFORMATEX, x4: DWORD,
                  x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInOpen".}
 proc waveInClose*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInClose".}
-proc waveInPrepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveInPrepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInPrepareHeader".}
-proc waveInUnprepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveInUnprepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInUnprepareHeader".}
-proc waveInAddBuffer*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.stdcall,
+proc waveInAddBuffer*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInAddBuffer".}
 proc waveInStart*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInStart".}
@@ -2428,11 +2425,11 @@ proc waveInStop*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInStop".}
 proc waveInReset*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInReset".}
-proc waveInGetPosition*(x1: HWAVEIN, x2: LPMMTIME, x3: UINT): MMRESULT{.stdcall,
+proc waveInGetPosition*(x1: HWAVEIN, x2: LPMMTIME, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetPosition".}
 proc waveInGetID*(x1: HWAVEIN, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetID".}
-proc waveInMessage*(x1: HWAVEIN, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc waveInMessage*(x1: HWAVEIN, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInMessage".}
 proc mixerGetLineControlsA*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSA, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
@@ -2440,13 +2437,13 @@ proc mixerGetLineControlsW*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSW, x3: DWORD):
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsW".}
 proc mixerGetLineControls*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLS, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
-proc joyGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc joyGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                              importc: "joyGetNumDevs".}
-proc joyGetDevCapsA*(x1: UINT, x2: LPJOYCAPSA, x3: UINT): MMRESULT{.stdcall,
+proc joyGetDevCapsA*(x1: uint32, x2: LPJOYCAPSA, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
-proc joyGetDevCapsW*(x1: UINT, x2: LPJOYCAPSW, x3: UINT): MMRESULT{.stdcall,
+proc joyGetDevCapsW*(x1: uint32, x2: LPJOYCAPSW, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetDevCapsW".}
-proc joyGetDevCaps*(x1: UINT, x2: LPJOYCAPS, x3: UINT): MMRESULT{.stdcall,
+proc joyGetDevCaps*(x1: uint32, x2: LPJOYCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
 proc mixerGetControlDetailsA*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
                               x3: DWORD): MMRESULT{.stdcall,
@@ -2456,46 +2453,46 @@ proc mixerGetControlDetailsW*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
     dynlib: "winmm.dll", importc: "mixerGetControlDetailsW".}
 proc mixerGetControlDetails*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetControlDetailsA".}
-proc timeGetSystemTime*(x1: LPMMTIME, x2: UINT): MMRESULT{.stdcall,
+proc timeGetSystemTime*(x1: LPMMTIME, x2: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "timeGetSystemTime".}
 proc timeGetTime*(): DWORD{.stdcall, dynlib: "winmm.dll", importc: "timeGetTime".}
-proc timeSetEvent*(x1: UINT, x2: UINT, x3: LPTIMECALLBACK, x4: DWORD, x5: UINT): MMRESULT{.
+proc timeSetEvent*(x1: uint32, x2: uint32, x3: LPTIMECALLBACK, x4: DWORD, x5: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "timeSetEvent".}
-proc timeKillEvent*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc timeKillEvent*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "timeKillEvent".}
-proc timeGetDevCaps*(x1: LPTIMECAPS, x2: UINT): MMRESULT{.stdcall,
+proc timeGetDevCaps*(x1: LPTIMECAPS, x2: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "timeGetDevCaps".}
-proc timeBeginPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc timeBeginPeriod*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "timeBeginPeriod".}
-proc timeEndPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc timeEndPeriod*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "timeEndPeriod".}
-proc mixerGetDevCapsA*(x1: UINT, x2: LPMIXERCAPSA, x3: UINT): MMRESULT{.stdcall,
+proc mixerGetDevCapsA*(x1: uint32, x2: LPMIXERCAPSA, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
-proc mixerGetDevCapsW*(x1: UINT, x2: LPMIXERCAPSW, x3: UINT): MMRESULT{.stdcall,
+proc mixerGetDevCapsW*(x1: uint32, x2: LPMIXERCAPSW, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetDevCapsW".}
-proc mixerGetDevCaps*(x1: UINT, x2: LPMIXERCAPS, x3: UINT): MMRESULT{.stdcall,
+proc mixerGetDevCaps*(x1: uint32, x2: LPMIXERCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
-proc mixerOpen*(x1: LPHMIXER, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
+proc mixerOpen*(x1: LPHMIXER, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerOpen".}
 proc mixerClose*(x1: HMIXER): MMRESULT{.stdcall, dynlib: "winmm.dll",
                                         importc: "mixerClose".}
-proc mixerMessage*(x1: HMIXER, x2: UINT, x3: DWORD, x4: DWORD): DWORD{.stdcall,
+proc mixerMessage*(x1: HMIXER, x2: uint32, x3: DWORD, x4: DWORD): DWORD{.stdcall,
     dynlib: "winmm.dll", importc: "mixerMessage".}
-proc auxGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc auxGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                              importc: "auxGetNumDevs".}
-proc auxGetDevCapsA*(x1: UINT, x2: LPAUXCAPSA, x3: UINT): MMRESULT{.stdcall,
+proc auxGetDevCapsA*(x1: uint32, x2: LPAUXCAPSA, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
-proc auxGetDevCapsW*(x1: UINT, x2: LPAUXCAPSW, x3: UINT): MMRESULT{.stdcall,
+proc auxGetDevCapsW*(x1: uint32, x2: LPAUXCAPSW, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetDevCapsW".}
-proc auxGetDevCaps*(x1: UINT, x2: LPAUXCAPS, x3: UINT): MMRESULT{.stdcall,
+proc auxGetDevCaps*(x1: uint32, x2: LPAUXCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
-proc auxSetVolume*(x1: UINT, x2: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc auxSetVolume*(x1: uint32, x2: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "auxSetVolume".}
-proc auxGetVolume*(x1: UINT, x2: LPDWORD): MMRESULT{.stdcall,
+proc auxGetVolume*(x1: uint32, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetVolume".}
-proc auxOutMessage*(x1: UINT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc auxOutMessage*(x1: uint32, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "auxOutMessage".}
-proc midiOutGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc midiOutGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                  importc: "midiOutGetNumDevs".}
 proc midiStreamOpen*(x1: LPHMIDISTRM, x2: LPUINT, x3: DWORD, x4: DWORD,
                      x5: DWORD, x6: DWORD): MMRESULT{.stdcall,
@@ -2504,9 +2501,9 @@ proc midiStreamClose*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiStreamClose".}
 proc midiStreamProperty*(x1: HMIDISTRM, x2: LPBYTE, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiStreamProperty".}
-proc midiStreamPosition*(x1: HMIDISTRM, x2: LPMMTIME, x3: UINT): MMRESULT{.
+proc midiStreamPosition*(x1: HMIDISTRM, x2: LPMMTIME, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiStreamPosition".}
-proc midiStreamOut*(x1: HMIDISTRM, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
+proc midiStreamOut*(x1: HMIDISTRM, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiStreamOut".}
 proc midiStreamPause*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiStreamPause".}
@@ -2518,67 +2515,67 @@ proc midiConnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiConnect".}
 proc midiDisconnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiDisconnect".}
-proc midiOutGetDevCapsA*(x1: UINT, x2: LPMIDIOUTCAPSA, x3: UINT): MMRESULT{.
+proc midiOutGetDevCapsA*(x1: uint32, x2: LPMIDIOUTCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
-proc midiOutGetDevCapsW*(x1: UINT, x2: LPMIDIOUTCAPSW, x3: UINT): MMRESULT{.
+proc midiOutGetDevCapsW*(x1: uint32, x2: LPMIDIOUTCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsW".}
-proc midiOutGetDevCaps*(x1: UINT, x2: LPMIDIOUTCAPS, x3: UINT): MMRESULT{.
+proc midiOutGetDevCaps*(x1: uint32, x2: LPMIDIOUTCAPS, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
 proc midiOutGetVolume*(x1: HMIDIOUT, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutGetVolume".}
 proc midiOutSetVolume*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutSetVolume".}
-proc midiOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.
+proc midiOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
-proc midiOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc midiOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextW".}
-proc midiOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc midiOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
-proc midiOutOpen*(x1: LPHMIDIOUT, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
+proc midiOutOpen*(x1: LPHMIDIOUT, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutOpen".}
 proc midiOutClose*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiOutClose".}
-proc midiOutPrepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiOutPrepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutPrepareHeader".}
-proc midiOutUnprepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiOutUnprepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutUnprepareHeader".}
 proc midiOutShortMsg*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutShortMsg".}
-proc midiOutLongMsg*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
+proc midiOutLongMsg*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutLongMsg".}
 proc midiOutReset*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiOutReset".}
-proc midiOutCachePatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): MMRESULT{.
+proc midiOutCachePatches*(x1: HMIDIOUT, x2: uint32, x3: LPWORD, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutCachePatches".}
-proc midiOutCacheDrumPatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): MMRESULT{.
+proc midiOutCacheDrumPatches*(x1: HMIDIOUT, x2: uint32, x3: LPWORD, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutCacheDrumPatches".}
 proc midiOutGetID*(x1: HMIDIOUT, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutGetID".}
-proc midiOutMessage*(x1: HMIDIOUT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc midiOutMessage*(x1: HMIDIOUT, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutMessage".}
-proc midiInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc midiInGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                 importc: "midiInGetNumDevs".}
-proc midiInGetDevCapsA*(x1: UINT, x2: LPMIDIINCAPSA, x3: UINT): MMRESULT{.
+proc midiInGetDevCapsA*(x1: uint32, x2: LPMIDIINCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
-proc midiInGetDevCapsW*(x1: UINT, x2: LPMIDIINCAPSW, x3: UINT): MMRESULT{.
+proc midiInGetDevCapsW*(x1: uint32, x2: LPMIDIINCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsW".}
-proc midiInGetDevCaps*(x1: UINT, x2: LPMIDIINCAPS, x3: UINT): MMRESULT{.stdcall,
+proc midiInGetDevCaps*(x1: uint32, x2: LPMIDIINCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
-proc midiInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
+proc midiInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
-proc midiInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc midiInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextW".}
-proc midiInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc midiInGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
-proc midiInOpen*(x1: LPHMIDIIN, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
+proc midiInOpen*(x1: LPHMIDIIN, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInOpen".}
 proc midiInClose*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiInClose".}
-proc midiInPrepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiInPrepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInPrepareHeader".}
-proc midiInUnprepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiInUnprepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInUnprepareHeader".}
-proc midiInAddBuffer*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
+proc midiInAddBuffer*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInAddBuffer".}
 proc midiInStart*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiInStart".}
@@ -2588,7 +2585,7 @@ proc midiInReset*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiInReset".}
 proc midiInGetID*(x1: HMIDIIN, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInGetID".}
-proc midiInMessage*(x1: HMIDIIN, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc midiInMessage*(x1: HMIDIIN, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInMessage".}
 proc mixerGetLineInfoA*(x1: HMIXEROBJ, x2: LPMIXERLINEA, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
@@ -2596,13 +2593,13 @@ proc mixerGetLineInfoW*(x1: HMIXEROBJ, x2: LPMIXERLINEW, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoW".}
 proc mixerGetLineInfo*(x1: HMIXEROBJ, x2: LPMIXERLINE, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
-proc mixerGetID*(x1: HMIXEROBJ, x2: var UINT, x3: DWORD): MMRESULT{.stdcall,
+proc mixerGetID*(x1: HMIXEROBJ, x2: var uint32, x3: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetID".}
-proc PlaySoundA*(x1: LPCSTR, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
+proc PlaySoundA*(x1: LPCSTR, x2: HMODULE, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "PlaySoundA".}
-proc PlaySoundW*(x1: LPCWSTR, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
+proc PlaySoundW*(x1: LPCWSTR, x2: HMODULE, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "PlaySoundW".}
-proc PlaySound*(x1: cstring, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
+proc PlaySound*(x1: cstring, x2: HMODULE, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "PlaySoundA".}
 # implementation
 
@@ -2610,7 +2607,7 @@ proc MEVT_EVENTTYPE(x: int8): int8 =
   result = toU8(x shr 24)
 
 proc MEVT_EVENTPARM(x: DWORD): DWORD =
-  result = x And 0x00FFFFFF
+  result = x and 0x00FFFFFF
 
 proc MCI_MSF_MINUTE(msf: int32): int8 =
   result = toU8(msf and 0xff)
@@ -2648,8 +2645,8 @@ proc MCI_MAKE_HMS(h, m, s: int8): int32 =
 proc MCI_TMSF_FRAME(tmsf: int32): int8 =
   result = toU8(tmsf shr 24)
 
-proc mci_Make_TMSF(t, m, s, f: int8): int32 =
+proc MCI_MAKE_TMSF(t, m, s, f: int8): int32 =
   result = (ze(t) or ze(m) shl 8 or ze(s) shl 16 or ze(f) shl 24).int32
 
 proc DIBINDEX(n: int32): int32 =
-  result = n Or 0x000010FF'i32 shl 16'i32
+  result = n or 0x000010FF'i32 shl 16'i32
diff --git a/lib/windows/nb30.nim b/lib/windows/nb30.nim
index be4a0616c..2e0c679ae 100644
--- a/lib/windows/nb30.nim
+++ b/lib/windows/nb30.nim
@@ -13,7 +13,7 @@
 {.deadCodeElim: on.}
 
 import                        # Data structure templates 
-  Windows
+  windows
 
 const 
   NCBNAMSZ* = 16              # absolute length of a net name
@@ -24,20 +24,20 @@ type                          # Network Control Block
   TNCBPostProc* = proc (P: PNCB) {.stdcall.}
   TNCB* {.final.} = object # Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed
                            # by an array of NAME_BUFFER structures.
-    ncb_command*: Char        # command code
-    ncb_retcode*: Char        # return code
-    ncb_lsn*: Char            # local session number
-    ncb_num*: Char            # number of our network name
+    ncb_command*: char        # command code
+    ncb_retcode*: char        # return code
+    ncb_lsn*: char            # local session number
+    ncb_num*: char            # number of our network name
     ncb_buffer*: cstring      # address of message buffer
     ncb_length*: int16        # size of message buffer
     ncb_callname*: array[0..NCBNAMSZ - 1, char] # blank-padded name of remote
     ncb_name*: array[0..NCBNAMSZ - 1, char] # our blank-padded netname
-    ncb_rto*: Char            # rcv timeout/retry count
-    ncb_sto*: Char            # send timeout/sys timeout
+    ncb_rto*: char            # rcv timeout/retry count
+    ncb_sto*: char            # send timeout/sys timeout
     ncb_post*: TNCBPostProc   # POST routine address
-    ncb_lana_num*: Char       # lana (adapter) number
-    ncb_cmd_cplt*: Char       # 0xff => commmand pending
-    ncb_reserve*: array[0..9, Char] # reserved, used by BIOS
+    ncb_lana_num*: char       # lana (adapter) number
+    ncb_cmd_cplt*: char       # 0xff => commmand pending
+    ncb_reserve*: array[0..9, char] # reserved, used by BIOS
     ncb_event*: THandle       # HANDLE to Win32 event which
                               # will be set to the signalled
                               # state when an ASYNCH command
@@ -45,11 +45,11 @@ type                          # Network Control Block
   
   PAdapterStatus* = ptr TAdapterStatus
   TAdapterStatus* {.final.} = object 
-    adapter_address*: array[0..5, Char]
-    rev_major*: Char
-    reserved0*: Char
-    adapter_type*: Char
-    rev_minor*: Char
+    adapter_address*: array[0..5, char]
+    rev_major*: char
+    reserved0*: char
+    adapter_type*: char
+    rev_minor*: char
     duration*: int16
     frmr_recv*: int16
     frmr_xmit*: int16
@@ -75,9 +75,9 @@ type                          # Network Control Block
 
   PNameBuffer* = ptr TNameBuffer
   TNameBuffer* {.final.} = object 
-    name*: array[0..NCBNAMSZ - 1, Char]
-    name_num*: Char
-    name_flags*: Char
+    name*: array[0..NCBNAMSZ - 1, char]
+    name_num*: char
+    name_flags*: char
 
 
 const                         # values for name_flags bits.
@@ -96,19 +96,19 @@ type # Structure returned to the NCB command NCBSSTAT is SESSION_HEADER followed
      # status for all names.
   PSessionHeader* = ptr TSessionHeader
   TSessionHeader* {.final.} = object 
-    sess_name*: Char
-    num_sess*: Char
-    rcv_dg_outstanding*: Char
-    rcv_any_outstanding*: Char
+    sess_name*: char
+    num_sess*: char
+    rcv_dg_outstanding*: char
+    rcv_any_outstanding*: char
 
   PSessionBuffer* = ptr TSessionBuffer
   TSessionBuffer* {.final.} = object 
-    lsn*: Char
-    state*: Char
-    local_name*: array[0..NCBNAMSZ - 1, Char]
-    remote_name*: array[0..NCBNAMSZ - 1, Char]
-    rcvs_outstanding*: Char
-    sends_outstanding*: Char
+    lsn*: char
+    state*: char
+    local_name*: array[0..NCBNAMSZ - 1, char]
+    remote_name*: array[0..NCBNAMSZ - 1, char]
+    rcvs_outstanding*: char
+    sends_outstanding*: char
 
 
 const                         # Values for state
@@ -125,24 +125,24 @@ type # Structure returned to the NCB command NCBENUM.
   PLanaEnum* = ptr TLanaEnum
   TLanaEnum* {.final.} = object # Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed
                                 # by an array of FIND_NAME_BUFFER structures.
-    len*: Char                #  Number of valid entries in lana[]
-    lana*: array[0..MAX_LANA, Char]
+    len*: char                #  Number of valid entries in lana[]
+    lana*: array[0..MAX_LANA, char]
 
   PFindNameHeader* = ptr TFindNameHeader
   TFindNameHeader* {.final.} = object 
     node_count*: int16
-    reserved*: Char
-    unique_group*: Char
+    reserved*: char
+    unique_group*: char
 
   PFindNameBuffer* = ptr TFindNameBuffer
   TFindNameBuffer* {.final.} = object # Structure provided with NCBACTION. The purpose of NCBACTION is to provide
                                       # transport specific extensions to netbios.
-    len*: Char
-    access_control*: Char
-    frame_control*: Char
-    destination_addr*: array[0..5, Char]
-    source_addr*: array[0..5, Char]
-    routing_info*: array[0..17, Char]
+    len*: char
+    access_control*: char
+    frame_control*: char
+    destination_addr*: array[0..5, char]
+    source_addr*: array[0..5, char]
+    routing_info*: array[0..17, char]
 
   PActionHeader* = ptr TActionHeader
   TActionHeader* {.final.} = object 
@@ -227,6 +227,6 @@ const                         # NCB Command codes
                               # main user entry point for NetBIOS 3.0
                               #   Usage: Result = Netbios( pncb ); 
 
-proc Netbios*(P: PNCB): Char{.stdcall, dynlib: "netapi32.dll", 
+proc Netbios*(P: PNCB): char{.stdcall, dynlib: "netapi32.dll", 
                               importc: "Netbios".}
 # implementation
diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim
index 9a280f551..079257680 100644
--- a/lib/windows/shellapi.nim
+++ b/lib/windows/shellapi.nim
@@ -28,14 +28,14 @@
 #    Copyright (c) Microsoft Corporation. All rights reserved.
 
 import
-  Windows
+  windows
 
 type
   HDROP* = THandle
-  UINT_PTR* = ptr UINT
+  UINT_PTR* = ptr uint32
   DWORD_PTR* = ptr DWORD
-  pHICON* = ptr HICON
-  pBool* = ptr BOOL
+  PHICON* = ptr HICON
+  PBool* = ptr bool
   STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows.
     cb*: DWORD
     lpReserved*: LPTSTR
@@ -60,27 +60,27 @@ type
   TSTARTUPINFOW* = STARTUPINFOW
   PSTARTUPINFOW* = ptr STARTUPINFOW #unicode
 
-proc DragQueryFileA*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
+proc DragQueryFileA*(arg1: HDROP, arg2: uint32, arg3: LPSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
-proc DragQueryFileW*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
+proc DragQueryFileW*(arg1: HDROP, arg2: uint32, arg3: LPWSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
-proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
+proc DragQueryFile*(arg1: HDROP, arg2: uint32, arg3: LPSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
-proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
+proc DragQueryFile*(arg1: HDROP, arg2: uint32, arg3: LPWSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
-proc DragQueryPoint*(arg1: HDROP, arg2: LPPOINT): BOOL{.stdcall,
+proc DragQueryPoint*(arg1: HDROP, arg2: LPPOINT): bool{.stdcall,
     dynlib: "shell32.dll", importc: "DragQueryPoint".}
 proc DragFinish*(arg1: HDROP){.stdcall, dynlib: "shell32.dll",
                                importc: "DragFinish".}
-proc DragAcceptFiles*(hwnd: HWND, arg2: BOOL){.stdcall, dynlib: "shell32.dll",
+proc DragAcceptFiles*(hwnd: HWND, arg2: bool){.stdcall, dynlib: "shell32.dll",
     importc: "DragAcceptFiles".}
-proc ShellExecuteA*(HWND: hwnd, lpOperation: LPCSTR, lpFile: LPCSTR,
+proc ShellExecuteA*(hwnd: HWND, lpOperation: LPCSTR, lpFile: LPCSTR,
                     lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
 proc ShellExecuteW*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
                     lpParameters: LPCWSTR, lpDirectory: LPCWSTR, nShowCmd: int32): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".}
-proc ShellExecute*(HWND: hwnd, lpOperation: LPCSTR, lpFile: LPCSTR,
+proc ShellExecute*(hwnd: HWND, lpOperation: LPCSTR, lpFile: LPCSTR,
                    lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
 proc ShellExecute*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
@@ -94,16 +94,16 @@ proc FindExecutable*(lpFile: LPCSTR, lpDirectory: LPCSTR, lpResult: LPSTR): HIns
     stdcall, dynlib: "shell32.dll", importc: "FindExecutableA".}
 proc FindExecutable*(lpFile: LPCWSTR, lpDirectory: LPCWSTR, lpResult: LPWSTR): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "FindExecutableW".}
-proc CommandLineToArgvW*(lpCmdLine: LPCWSTR, pNumArgs: ptr int32): pLPWSTR{.
+proc CommandLineToArgvW*(lpCmdLine: LPCWSTR, pNumArgs: ptr int32): PLPWSTR{.
     stdcall, dynlib: "shell32.dll", importc: "CommandLineToArgvW".}
-proc ShellAboutA*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon): int32{.
+proc ShellAboutA*(hwnd: HWND, szApp: LPCSTR, szOtherStuff: LPCSTR, hIcon: HICON): int32{.
     stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
-proc ShellAboutW*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR,
-                  HICON: hIcon): int32{.stdcall, dynlib: "shell32.dll",
+proc ShellAboutW*(hwnd: HWND, szApp: LPCWSTR, szOtherStuff: LPCWSTR,
+                  hIcon: HICON): int32{.stdcall, dynlib: "shell32.dll",
                                         importc: "ShellAboutW".}
-proc ShellAbout*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon): int32{.
+proc ShellAbout*(hwnd: HWND, szApp: LPCSTR, szOtherStuff: LPCSTR, hIcon: HICON): int32{.
     stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
-proc ShellAbout*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR, HICON: hIcon): int32{.
+proc ShellAbout*(hwnd: HWND, szApp: LPCWSTR, szOtherStuff: LPCWSTR, hIcon: HICON): int32{.
     stdcall, dynlib: "shell32.dll", importc: "ShellAboutW".}
 proc DuplicateIcon*(inst: HINST, icon: HICON): HIcon{.stdcall,
     dynlib: "shell32.dll", importc: "DuplicateIcon".}
@@ -115,29 +115,29 @@ proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): H
     stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
 proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".}
-proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: UINT): HICON{.
+proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
-proc ExtractIconW*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
+proc ExtractIconW*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
-proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: UINT): HICON{.
+proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
-proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
+proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
   # if(WINVER >= 0x0400)
 type                          # init with sizeof(DRAGINFO)
   DRAGINFOA* {.final.} = object
-    uSize*: UINT
+    uSize*: uint32
     pt*: POINT
-    fNC*: BOOL
+    fNC*: bool
     lpFileList*: LPSTR
     grfKeyState*: DWORD
 
   TDRAGINFOA* = DRAGINFOA
   LPDRAGINFOA* = ptr DRAGINFOA # init with sizeof(DRAGINFO)
   DRAGINFOW* {.final.} = object
-    uSize*: UINT
+    uSize*: uint32
     pt*: POINT
-    fNC*: BOOL
+    fNC*: bool
     lpFileList*: LPWSTR
     grfKeyState*: DWORD
 
@@ -184,8 +184,8 @@ type
   AppBarData* {.final.} = object
     cbSize*: DWORD
     hWnd*: HWND
-    uCallbackMessage*: UINT
-    uEdge*: UINT
+    uCallbackMessage*: uint32
+    uEdge*: uint32
     rc*: RECT
     lParam*: LPARAM           # message specific
 
@@ -197,41 +197,41 @@ proc SHAppBarMessage*(dwMessage: DWORD, pData: APPBARDATA): UINT_PTR{.stdcall,
   #
   #  EndAppBar
   #
-proc DoEnvironmentSubstA*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubstA*(szString: LPSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
-proc DoEnvironmentSubstW*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubstW*(szString: LPWSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
-proc DoEnvironmentSubst*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubst*(szString: LPSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
-proc DoEnvironmentSubst*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubst*(szString: LPWSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
   #Macro
 proc EIRESID*(x: int32): int32
-proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
-                     phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: PHICON,
+                     phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExA".}
-proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
-                     phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: PHICON,
+                     phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExW".}
 proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32,
                      phiconLarge: var HICON, phiconSmall: var HIcon,
-                     nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
+                     nIcons: uint32): uint32{.stdcall, dynlib: "shell32.dll",
     importc: "ExtractIconExA".}
 proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32,
                      phiconLarge: var HICON, phiconSmall: var HIcon,
-                     nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
+                     nIcons: uint32): uint32{.stdcall, dynlib: "shell32.dll",
     importc: "ExtractIconExW".}
-proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
-                    phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: PHICON,
+                    phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExA".}
-proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
-                    phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: PHICON,
+                    phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExW".}
 proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: var HICON,
-                    phiconSmall: var HIcon, nIcons: UINT): UINT{.stdcall,
+                    phiconSmall: var HIcon, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExA".}
 proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32,
-                    phiconLarge: var HICON, phiconSmall: var HIcon, nIcons: UINT): UINT{.
+                    phiconLarge: var HICON, phiconSmall: var HIcon, nIcons: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconExW".}
   #
   # Shell File Operations
@@ -291,11 +291,11 @@ type
 type
   SHFILEOPSTRUCTA* {.final.} = object
     hwnd*: HWND
-    wFunc*: UINT
+    wFunc*: uint32
     pFrom*: LPCSTR
     pTo*: LPCSTR
     fFlags*: FILEOP_FLAGS
-    fAnyOperationsAborted*: BOOL
+    fAnyOperationsAborted*: bool
     hNameMappings*: LPVOID
     lpszProgressTitle*: LPCSTR # only used if FOF_SIMPLEPROGRESS
 
@@ -303,11 +303,11 @@ type
   LPSHFILEOPSTRUCTA* = ptr SHFILEOPSTRUCTA
   SHFILEOPSTRUCTW* {.final.} = object
     hwnd*: HWND
-    wFunc*: UINT
+    wFunc*: uint32
     pFrom*: LPCWSTR
     pTo*: LPCWSTR
     fFlags*: FILEOP_FLAGS
-    fAnyOperationsAborted*: BOOL
+    fAnyOperationsAborted*: bool
     hNameMappings*: LPVOID
     lpszProgressTitle*: LPCWSTR
 
@@ -430,10 +430,10 @@ type
     cbSize*: DWORD
     fMask*: ULONG
     hwnd*: HWND
-    lpVerb*: lpcwstr
-    lpFile*: lpcwstr
-    lpParameters*: lpcwstr
-    lpDirectory*: lpcwstr
+    lpVerb*: LPCWSTR
+    lpFile*: LPCWSTR
+    lpParameters*: LPCWSTR
+    lpDirectory*: LPCWSTR
     nShow*: int32
     hInstApp*: HINST
     lpIDList*: LPVOID
@@ -456,24 +456,24 @@ else:
     SHELLEXECUTEINFO* = SHELLEXECUTEINFOA
     TSHELLEXECUTEINFO* = SHELLEXECUTEINFOA
     LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOA
-proc ShellExecuteExA*(lpExecInfo: LPSHELLEXECUTEINFOA): Bool{.stdcall,
+proc ShellExecuteExA*(lpExecInfo: LPSHELLEXECUTEINFOA): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExA".}
-proc ShellExecuteExW*(lpExecInfo: LPSHELLEXECUTEINFOW): Bool{.stdcall,
+proc ShellExecuteExW*(lpExecInfo: LPSHELLEXECUTEINFOW): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExW".}
-proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOA): Bool{.stdcall,
+proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOA): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExA".}
-proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOW): Bool{.stdcall,
+proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOW): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExW".}
-proc WinExecErrorA*(HWND: hwnd, error: int32, lpstrFileName: LPCSTR,
+proc WinExecErrorA*(hwnd: HWND, error: int32, lpstrFileName: LPCSTR,
                     lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
     importc: "WinExecErrorA".}
-proc WinExecErrorW*(HWND: hwnd, error: int32, lpstrFileName: LPCWSTR,
+proc WinExecErrorW*(hwnd: HWND, error: int32, lpstrFileName: LPCWSTR,
                     lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
     importc: "WinExecErrorW".}
-proc WinExecError*(HWND: hwnd, error: int32, lpstrFileName: LPCSTR,
+proc WinExecError*(hwnd: HWND, error: int32, lpstrFileName: LPCSTR,
                    lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
                                         importc: "WinExecErrorA".}
-proc WinExecError*(HWND: hwnd, error: int32, lpstrFileName: LPCWSTR,
+proc WinExecError*(hwnd: HWND, error: int32, lpstrFileName: LPCWSTR,
                    lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
     importc: "WinExecErrorW".}
 type
@@ -487,7 +487,7 @@ type
     hUserToken*: HANDLE
     lpProcessAttributes*: LPSECURITY_ATTRIBUTES
     lpThreadAttributes*: LPSECURITY_ATTRIBUTES
-    bInheritHandles*: BOOL
+    bInheritHandles*: bool
     dwCreationFlags*: DWORD
     lpStartupInfo*: LPSTARTUPINFOW
     lpProcessInformation*: LPPROCESS_INFORMATION
@@ -495,7 +495,7 @@ type
   TSHCREATEPROCESSINFOW* = SHCREATEPROCESSINFOW
   PSHCREATEPROCESSINFOW* = ptr SHCREATEPROCESSINFOW
 
-proc SHCreateProcessAsUserW*(pscpi: PSHCREATEPROCESSINFOW): Bool{.stdcall,
+proc SHCreateProcessAsUserW*(pscpi: PSHCREATEPROCESSINFOW): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHCreateProcessAsUserW".}
   #
   #  End ShellExecuteEx and family }
@@ -544,16 +544,16 @@ type
   NOTIFYICONDATAA* {.final.} = object
     cbSize*: DWORD
     hWnd*: HWND
-    uID*: UINT
-    uFlags*: UINT
-    uCallbackMessage*: UINT
+    uID*: uint32
+    uFlags*: uint32
+    uCallbackMessage*: uint32
     hIcon*: HICON
-    szTip*: array[0..127, CHAR]
+    szTip*: array[0..127, char]
     dwState*: DWORD
     dwStateMask*: DWORD
-    szInfo*: array[0..255, CHAR]
-    uTimeout*: UINT           # also: uVersion
-    szInfoTitle*: array[0..63, CHAR]
+    szInfo*: array[0..255, char]
+    uTimeout*: uint32           # also: uVersion
+    szInfoTitle*: array[0..63, char]
     dwInfoFlags*: DWORD
     guidItem*: TGUID
 
@@ -562,16 +562,16 @@ type
   NOTIFYICONDATAW* {.final.} = object
     cbSize*: DWORD
     hWnd*: HWND
-    uID*: UINT
-    uFlags*: UINT
-    uCallbackMessage*: UINT
+    uID*: uint32
+    uFlags*: uint32
+    uCallbackMessage*: uint32
     hIcon*: HICON
-    szTip*: array[0..127, WCHAR]
+    szTip*: array[0..127, Wchar]
     dwState*: DWORD
     dwStateMask*: DWORD
-    szInfo*: array[0..255, WCHAR]
-    uTimeout*: UINT           # also uVersion : UINT
-    szInfoTitle*: array[0..63, CHAR]
+    szInfo*: array[0..255, Wchar]
+    uTimeout*: uint32           # also uVersion : UINT
+    szInfoTitle*: array[0..63, char]
     dwInfoFlags*: DWORD
     guidItem*: TGUID
 
@@ -619,13 +619,13 @@ const
   NIIF_ICON_MASK* = 0x0000000F
   NIIF_NOSOUND* = 0x00000010
 
-proc Shell_NotifyIconA*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): Bool{.
+proc Shell_NotifyIconA*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
-proc Shell_NotifyIconW*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): Bool{.
+proc Shell_NotifyIconW*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
-proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): Bool{.
+proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
-proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): Bool{.
+proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
   #
   #       The SHGetFileInfo API provides an easy way to get attributes
@@ -652,20 +652,20 @@ type
     hIcon*: HICON             # out: icon
     iIcon*: int32             # out: icon index
     dwAttributes*: DWORD      # out: SFGAO_ flags
-    szDisplayName*: array[0..(MAX_PATH) - 1, CHAR] # out: display name (or path)
-    szTypeName*: array[0..79, CHAR] # out: type name
+    szDisplayName*: array[0..(MAX_PATH) - 1, char] # out: display name (or path)
+    szTypeName*: array[0..79, char] # out: type name
 
   TSHFILEINFOA* = SHFILEINFOA
-  pSHFILEINFOA* = ptr SHFILEINFOA
+  PSHFILEINFOA* = ptr SHFILEINFOA
   SHFILEINFOW* {.final.} = object
     hIcon*: HICON             # out: icon
     iIcon*: int32             # out: icon index
     dwAttributes*: DWORD      # out: SFGAO_ flags
-    szDisplayName*: array[0..(MAX_PATH) - 1, WCHAR] # out: display name (or path)
-    szTypeName*: array[0..79, WCHAR] # out: type name
+    szDisplayName*: array[0..(MAX_PATH) - 1, Wchar] # out: display name (or path)
+    szTypeName*: array[0..79, Wchar] # out: type name
 
   TSHFILEINFOW* = SHFILEINFOW
-  pSHFILEINFOW* = ptr SHFILEINFOW
+  PSHFILEINFOW* = ptr SHFILEINFOW
 
 when defined(UNICODE):
   type
@@ -701,67 +701,67 @@ const
                                    # in the upper 8 bits of the iIcon
 
 proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                     psfi: pSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: PSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                     psfi: pSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: PSHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
 proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                    psfi: pSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                    psfi: PSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                     psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: var TSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                     psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: var TSHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
 proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                    psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                    psfi: var TSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfo*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                    psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+                    psfi: var TSHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
 proc SHGetDiskFreeSpaceExA*(pszDirectoryName: LPCSTR,
-                            pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                            pulTotalNumberOfBytes: pULARGE_INTEGER,
-                            pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                            pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                            pulTotalNumberOfBytes: PULARGE_INTEGER,
+                            pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
 proc SHGetDiskFreeSpaceExW*(pszDirectoryName: LPCWSTR,
-                            pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                            pulTotalNumberOfBytes: pULARGE_INTEGER,
-                            pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                            pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                            pulTotalNumberOfBytes: PULARGE_INTEGER,
+                            pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
 proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCSTR,
-                           pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                           pulTotalNumberOfBytes: pULARGE_INTEGER,
-                           pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                           pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                           pulTotalNumberOfBytes: PULARGE_INTEGER,
+                           pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
 proc SHGetDiskFreeSpace*(pszDirectoryName: LPCSTR,
-                         pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                         pulTotalNumberOfBytes: pULARGE_INTEGER,
-                         pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                         pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                         pulTotalNumberOfBytes: PULARGE_INTEGER,
+                         pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
 proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCWSTR,
-                           pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                           pulTotalNumberOfBytes: pULARGE_INTEGER,
-                           pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                           pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                           pulTotalNumberOfBytes: PULARGE_INTEGER,
+                           pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
 proc SHGetDiskFreeSpace*(pszDirectoryName: LPCWSTR,
-                         pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                         pulTotalNumberOfBytes: pULARGE_INTEGER,
-                         pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                         pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                         pulTotalNumberOfBytes: PULARGE_INTEGER,
+                         pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
 proc SHGetNewLinkInfoA*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
-                        pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                        pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
 proc SHGetNewLinkInfoW*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
-                        pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                        pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
 proc SHGetNewLinkInfo*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
-                       pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                       pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
 proc SHGetNewLinkInfo*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
-                       pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                       pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
 const
   SHGNLI_PIDL* = 0x00000001   # pszLinkTo is a pidl
@@ -777,17 +777,17 @@ const
   PRINTACTION_DOCUMENTDEFAULTS* = 6
   PRINTACTION_SERVERPROPERTIES* = 7
 
-proc SHInvokePrinterCommandA*(HWND: hwnd, uAction: UINT, lpBuf1: LPCSTR,
-                              lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommandA*(hwnd: HWND, uAction: uint32, lpBuf1: LPCSTR,
+                              lpBuf2: LPCSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
-proc SHInvokePrinterCommandW*(HWND: hwnd, uAction: UINT, lpBuf1: LPCWSTR,
-                              lpBuf2: LPCWSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommandW*(hwnd: HWND, uAction: uint32, lpBuf1: LPCWSTR,
+                              lpBuf2: LPCWSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
-proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, lpBuf1: LPCSTR,
-                             lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommand*(hwnd: HWND, uAction: uint32, lpBuf1: LPCSTR,
+                             lpBuf2: LPCSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
-proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, lpBuf1: LPCWSTR,
-                             lpBuf2: LPCWSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommand*(hwnd: HWND, uAction: uint32, lpBuf1: LPCWSTR,
+                             lpBuf2: LPCWSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
 proc SHLoadNonloadedIconOverlayIdentifiers*(): HResult{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
diff --git a/lib/wrappers/iup.nim b/lib/wrappers/iup.nim
index 2ee1ca3ee..dd98b84b8 100644
--- a/lib/wrappers/iup.nim
+++ b/lib/wrappers/iup.nim
@@ -46,44 +46,44 @@ const
   constIUP_VERSION_DATE* = "2009/07/18"
 
 type
-  Ihandle {.pure.} = object
+  Ihandle = object
   PIhandle* = ptr Ihandle
 
   Icallback* = proc (arg: PIhandle): cint {.cdecl.}
 
-#                      pre-definided dialogs
-proc FileDlg*: PIhandle {.importc: "IupFileDlg", dynlib: dllname, cdecl.}
-proc MessageDlg*: PIhandle {.importc: "IupMessageDlg", dynlib: dllname, cdecl.}
-proc ColorDlg*: PIhandle {.importc: "IupColorDlg", dynlib: dllname, cdecl.}
-proc FontDlg*: PIhandle {.importc: "IupFontDlg", dynlib: dllname, cdecl.}
+#                      pre-defineded dialogs
+proc fileDlg*: PIhandle {.importc: "IupFileDlg", dynlib: dllname, cdecl.}
+proc messageDlg*: PIhandle {.importc: "IupMessageDlg", dynlib: dllname, cdecl.}
+proc colorDlg*: PIhandle {.importc: "IupColorDlg", dynlib: dllname, cdecl.}
+proc fontDlg*: PIhandle {.importc: "IupFontDlg", dynlib: dllname, cdecl.}
 
-proc GetFile*(arq: cstring): cint {.
+proc getFile*(arq: cstring): cint {.
   importc: "IupGetFile", dynlib: dllname, cdecl.}
-proc Message*(title, msg: cstring) {.
+proc message*(title, msg: cstring) {.
   importc: "IupMessage", dynlib: dllname, cdecl.}
-proc Messagef*(title, format: cstring) {.
+proc messagef*(title, format: cstring) {.
   importc: "IupMessagef", dynlib: dllname, cdecl, varargs.}
-proc Alarm*(title, msg, b1, b2, b3: cstring): cint {.
+proc alarm*(title, msg, b1, b2, b3: cstring): cint {.
   importc: "IupAlarm", dynlib: dllname, cdecl.}
-proc Scanf*(format: cstring): cint {.
+proc scanf*(format: cstring): cint {.
   importc: "IupScanf", dynlib: dllname, cdecl, varargs.}
-proc ListDialog*(theType: cint, title: cstring, size: cint, 
+proc listDialog*(theType: cint, title: cstring, size: cint, 
                  list: cstringArray, op, max_col, max_lin: cint, 
                  marks: ptr cint): cint {.
                  importc: "IupListDialog", dynlib: dllname, cdecl.}
-proc GetText*(title, text: cstring): cint {.
+proc getText*(title, text: cstring): cint {.
   importc: "IupGetText", dynlib: dllname, cdecl.}
-proc GetColor*(x, y: cint, r, g, b: var byte): cint {.
+proc getColor*(x, y: cint, r, g, b: var byte): cint {.
   importc: "IupGetColor", dynlib: dllname, cdecl.}
 
 type
   Iparamcb* = proc (dialog: PIhandle, param_index: cint, 
                     user_data: pointer): cint {.cdecl.}
 
-proc GetParam*(title: cstring, action: Iparamcb, user_data: pointer, 
+proc getParam*(title: cstring, action: Iparamcb, user_data: pointer, 
                format: cstring): cint {.
                importc: "IupGetParam", cdecl, varargs, dynlib: dllname.}
-proc GetParamv*(title: cstring, action: Iparamcb, user_data: pointer, 
+proc getParamv*(title: cstring, action: Iparamcb, user_data: pointer, 
                 format: cstring, param_count, param_extra: cint, 
                 param_data: pointer): cint {.
                 importc: "IupGetParamv", cdecl, dynlib: dllname.}
@@ -91,276 +91,276 @@ proc GetParamv*(title: cstring, action: Iparamcb, user_data: pointer,
 
 #                      Functions
 
-proc Open*(argc: ptr cint, argv: ptr cstringArray): cint {.
+proc open*(argc: ptr cint, argv: ptr cstringArray): cint {.
   importc: "IupOpen", cdecl, dynlib: dllname.}
-proc Close*() {.importc: "IupClose", cdecl, dynlib: dllname.}
-proc ImageLibOpen*() {.importc: "IupImageLibOpen", cdecl, dynlib: dllname.}
+proc close*() {.importc: "IupClose", cdecl, dynlib: dllname.}
+proc imageLibOpen*() {.importc: "IupImageLibOpen", cdecl, dynlib: dllname.}
 
-proc MainLoop*(): cint {.importc: "IupMainLoop", cdecl, dynlib: dllname, 
+proc mainLoop*(): cint {.importc: "IupMainLoop", cdecl, dynlib: dllname, 
                          discardable.}
-proc LoopStep*(): cint {.importc: "IupLoopStep", cdecl, dynlib: dllname,
+proc loopStep*(): cint {.importc: "IupLoopStep", cdecl, dynlib: dllname,
                          discardable.}
-proc MainLoopLevel*(): cint {.importc: "IupMainLoopLevel", cdecl, 
+proc mainLoopLevel*(): cint {.importc: "IupMainLoopLevel", cdecl, 
                               dynlib: dllname, discardable.}
-proc Flush*() {.importc: "IupFlush", cdecl, dynlib: dllname.}
-proc ExitLoop*() {.importc: "IupExitLoop", cdecl, dynlib: dllname.}
-
-proc Update*(ih: PIhandle) {.importc: "IupUpdate", cdecl, dynlib: dllname.}
-proc UpdateChildren*(ih: PIhandle) {.importc: "IupUpdateChildren", cdecl, dynlib: dllname.}
-proc Redraw*(ih: PIhandle, children: cint) {.importc: "IupRedraw", cdecl, dynlib: dllname.}
-proc Refresh*(ih: PIhandle) {.importc: "IupRefresh", cdecl, dynlib: dllname.}
-
-proc MapFont*(iupfont: cstring): cstring {.importc: "IupMapFont", cdecl, dynlib: dllname.}
-proc UnMapFont*(driverfont: cstring): cstring {.importc: "IupUnMapFont", cdecl, dynlib: dllname.}
-proc Help*(url: cstring): cint {.importc: "IupHelp", cdecl, dynlib: dllname.}
-proc Load*(filename: cstring): cstring {.importc: "IupLoad", cdecl, dynlib: dllname.}
-
-proc IupVersion*(): cstring {.importc: "IupVersion", cdecl, dynlib: dllname.}
-proc IupVersionDate*(): cstring {.importc: "IupVersionDate", cdecl, dynlib: dllname.}
-proc IupVersionNumber*(): cint {.importc: "IupVersionNumber", cdecl, dynlib: dllname.}
-proc SetLanguage*(lng: cstring) {.importc: "IupSetLanguage", cdecl, dynlib: dllname.}
-proc GetLanguage*(): cstring {.importc: "IupGetLanguage", cdecl, dynlib: dllname.}
-
-proc Destroy*(ih: PIhandle) {.importc: "IupDestroy", cdecl, dynlib: dllname.}
-proc Detach*(child: PIhandle) {.importc: "IupDetach", cdecl, dynlib: dllname.}
-proc Append*(ih, child: PIhandle): PIhandle {.
+proc flush*() {.importc: "IupFlush", cdecl, dynlib: dllname.}
+proc exitLoop*() {.importc: "IupExitLoop", cdecl, dynlib: dllname.}
+
+proc update*(ih: PIhandle) {.importc: "IupUpdate", cdecl, dynlib: dllname.}
+proc updateChildren*(ih: PIhandle) {.importc: "IupUpdateChildren", cdecl, dynlib: dllname.}
+proc redraw*(ih: PIhandle, children: cint) {.importc: "IupRedraw", cdecl, dynlib: dllname.}
+proc refresh*(ih: PIhandle) {.importc: "IupRefresh", cdecl, dynlib: dllname.}
+
+proc mapFont*(iupfont: cstring): cstring {.importc: "IupMapFont", cdecl, dynlib: dllname.}
+proc unMapFont*(driverfont: cstring): cstring {.importc: "IupUnMapFont", cdecl, dynlib: dllname.}
+proc help*(url: cstring): cint {.importc: "IupHelp", cdecl, dynlib: dllname.}
+proc load*(filename: cstring): cstring {.importc: "IupLoad", cdecl, dynlib: dllname.}
+
+proc iupVersion*(): cstring {.importc: "IupVersion", cdecl, dynlib: dllname.}
+proc iupVersionDate*(): cstring {.importc: "IupVersionDate", cdecl, dynlib: dllname.}
+proc iupVersionNumber*(): cint {.importc: "IupVersionNumber", cdecl, dynlib: dllname.}
+proc setLanguage*(lng: cstring) {.importc: "IupSetLanguage", cdecl, dynlib: dllname.}
+proc getLanguage*(): cstring {.importc: "IupGetLanguage", cdecl, dynlib: dllname.}
+
+proc destroy*(ih: PIhandle) {.importc: "IupDestroy", cdecl, dynlib: dllname.}
+proc detach*(child: PIhandle) {.importc: "IupDetach", cdecl, dynlib: dllname.}
+proc append*(ih, child: PIhandle): PIhandle {.
   importc: "IupAppend", cdecl, dynlib: dllname, discardable.}
-proc Insert*(ih, ref_child, child: PIhandle): PIhandle {.
+proc insert*(ih, ref_child, child: PIhandle): PIhandle {.
   importc: "IupInsert", cdecl, dynlib: dllname, discardable.}
-proc GetChild*(ih: PIhandle, pos: cint): PIhandle {.
+proc getChild*(ih: PIhandle, pos: cint): PIhandle {.
   importc: "IupGetChild", cdecl, dynlib: dllname.}
-proc GetChildPos*(ih, child: PIhandle): cint {.
+proc getChildPos*(ih, child: PIhandle): cint {.
   importc: "IupGetChildPos", cdecl, dynlib: dllname.}
-proc GetChildCount*(ih: PIhandle): cint {.
+proc getChildCount*(ih: PIhandle): cint {.
   importc: "IupGetChildCount", cdecl, dynlib: dllname.}
-proc GetNextChild*(ih, child: PIhandle): PIhandle {.
+proc getNextChild*(ih, child: PIhandle): PIhandle {.
   importc: "IupGetNextChild", cdecl, dynlib: dllname.}
-proc GetBrother*(ih: PIhandle): PIhandle {.
+proc getBrother*(ih: PIhandle): PIhandle {.
   importc: "IupGetBrother", cdecl, dynlib: dllname.}
-proc GetParent*(ih: PIhandle): PIhandle {.
+proc getParent*(ih: PIhandle): PIhandle {.
   importc: "IupGetParent", cdecl, dynlib: dllname.}
-proc GetDialog*(ih: PIhandle): PIhandle {.
+proc getDialog*(ih: PIhandle): PIhandle {.
   importc: "IupGetDialog", cdecl, dynlib: dllname.}
-proc GetDialogChild*(ih: PIhandle, name: cstring): PIhandle {.
+proc getDialogChild*(ih: PIhandle, name: cstring): PIhandle {.
   importc: "IupGetDialogChild", cdecl, dynlib: dllname.}
-proc Reparent*(ih, new_parent: PIhandle): cint {.
+proc reparent*(ih, new_parent: PIhandle): cint {.
   importc: "IupReparent", cdecl, dynlib: dllname.}
 
-proc Popup*(ih: PIhandle, x, y: cint): cint {.
+proc popup*(ih: PIhandle, x, y: cint): cint {.
   importc: "IupPopup", cdecl, dynlib: dllname, discardable.}
-proc Show*(ih: PIhandle): cint {.
+proc show*(ih: PIhandle): cint {.
   importc: "IupShow", cdecl, dynlib: dllname, discardable.}
-proc ShowXY*(ih: PIhandle, x, y: cint): cint {.
+proc showXY*(ih: PIhandle, x, y: cint): cint {.
   importc: "IupShowXY", cdecl, dynlib: dllname, discardable.}
-proc Hide*(ih: PIhandle): cint {.
+proc hide*(ih: PIhandle): cint {.
   importc: "IupHide", cdecl, dynlib: dllname, discardable.}
-proc Map*(ih: PIhandle): cint {.
+proc map*(ih: PIhandle): cint {.
   importc: "IupMap", cdecl, dynlib: dllname, discardable.}
-proc Unmap*(ih: PIhandle) {.
+proc unmap*(ih: PIhandle) {.
   importc: "IupUnmap", cdecl, dynlib: dllname, discardable.}
 
-proc SetAttribute*(ih: PIhandle, name, value: cstring) {.
+proc setAttribute*(ih: PIhandle, name, value: cstring) {.
   importc: "IupSetAttribute", cdecl, dynlib: dllname.}
-proc StoreAttribute*(ih: PIhandle, name, value: cstring) {.
+proc storeAttribute*(ih: PIhandle, name, value: cstring) {.
   importc: "IupStoreAttribute", cdecl, dynlib: dllname.}
-proc SetAttributes*(ih: PIhandle, str: cstring): PIhandle {.
+proc setAttributes*(ih: PIhandle, str: cstring): PIhandle {.
   importc: "IupSetAttributes", cdecl, dynlib: dllname.}
-proc GetAttribute*(ih: PIhandle, name: cstring): cstring {.
+proc getAttribute*(ih: PIhandle, name: cstring): cstring {.
   importc: "IupGetAttribute", cdecl, dynlib: dllname.}
-proc GetAttributes*(ih: PIhandle): cstring {.
+proc getAttributes*(ih: PIhandle): cstring {.
   importc: "IupGetAttributes", cdecl, dynlib: dllname.}
-proc GetInt*(ih: PIhandle, name: cstring): cint {.
+proc getInt*(ih: PIhandle, name: cstring): cint {.
   importc: "IupGetInt", cdecl, dynlib: dllname.}
-proc GetInt2*(ih: PIhandle, name: cstring): cint {.
+proc getInt2*(ih: PIhandle, name: cstring): cint {.
   importc: "IupGetInt2", cdecl, dynlib: dllname.}
-proc GetIntInt*(ih: PIhandle, name: cstring, i1, i2: var cint): cint {.
+proc getIntInt*(ih: PIhandle, name: cstring, i1, i2: var cint): cint {.
   importc: "IupGetIntInt", cdecl, dynlib: dllname.}
-proc GetFloat*(ih: PIhandle, name: cstring): cfloat {.
+proc getFloat*(ih: PIhandle, name: cstring): cfloat {.
   importc: "IupGetFloat", cdecl, dynlib: dllname.}
-proc SetfAttribute*(ih: PIhandle, name, format: cstring) {.
+proc setfAttribute*(ih: PIhandle, name, format: cstring) {.
   importc: "IupSetfAttribute", cdecl, dynlib: dllname, varargs.}
-proc GetAllAttributes*(ih: PIhandle, names: cstringArray, n: cint): cint {.
+proc getAllAttributes*(ih: PIhandle, names: cstringArray, n: cint): cint {.
   importc: "IupGetAllAttributes", cdecl, dynlib: dllname.}
-proc SetAtt*(handle_name: cstring, ih: PIhandle, name: cstring): PIhandle {.
+proc setAtt*(handle_name: cstring, ih: PIhandle, name: cstring): PIhandle {.
   importc: "IupSetAtt", cdecl, dynlib: dllname, varargs, discardable.}
 
-proc SetGlobal*(name, value: cstring) {.
+proc setGlobal*(name, value: cstring) {.
   importc: "IupSetGlobal", cdecl, dynlib: dllname.}
-proc StoreGlobal*(name, value: cstring) {.
+proc storeGlobal*(name, value: cstring) {.
   importc: "IupStoreGlobal", cdecl, dynlib: dllname.}
-proc GetGlobal*(name: cstring): cstring {.
+proc getGlobal*(name: cstring): cstring {.
   importc: "IupGetGlobal", cdecl, dynlib: dllname.}
 
-proc SetFocus*(ih: PIhandle): PIhandle {.
+proc setFocus*(ih: PIhandle): PIhandle {.
   importc: "IupSetFocus", cdecl, dynlib: dllname.}
-proc GetFocus*(): PIhandle {.
+proc getFocus*(): PIhandle {.
   importc: "IupGetFocus", cdecl, dynlib: dllname.}
-proc PreviousField*(ih: PIhandle): PIhandle {.
+proc previousField*(ih: PIhandle): PIhandle {.
   importc: "IupPreviousField", cdecl, dynlib: dllname.}
-proc NextField*(ih: PIhandle): PIhandle {.
+proc nextField*(ih: PIhandle): PIhandle {.
   importc: "IupNextField", cdecl, dynlib: dllname.}
 
-proc GetCallback*(ih: PIhandle, name: cstring): Icallback {.
+proc getCallback*(ih: PIhandle, name: cstring): Icallback {.
   importc: "IupGetCallback", cdecl, dynlib: dllname.}
-proc SetCallback*(ih: PIhandle, name: cstring, func: Icallback): Icallback {.
+proc setCallback*(ih: PIhandle, name: cstring, func: Icallback): Icallback {.
   importc: "IupSetCallback", cdecl, dynlib: dllname, discardable.}
   
-proc SetCallbacks*(ih: PIhandle, name: cstring, func: Icallback): PIhandle {.
+proc setCallbacks*(ih: PIhandle, name: cstring, func: Icallback): PIhandle {.
   importc: "IupSetCallbacks", cdecl, dynlib: dllname, varargs, discardable.}
 
-proc GetFunction*(name: cstring): Icallback {.
+proc getFunction*(name: cstring): Icallback {.
   importc: "IupGetFunction", cdecl, dynlib: dllname.}
-proc SetFunction*(name: cstring, func: Icallback): Icallback {.
+proc setFunction*(name: cstring, func: Icallback): Icallback {.
   importc: "IupSetFunction", cdecl, dynlib: dllname, discardable.}
-proc GetActionName*(): cstring {.
+proc getActionName*(): cstring {.
   importc: "IupGetActionName", cdecl, dynlib: dllname.}
 
-proc GetHandle*(name: cstring): PIhandle {.
+proc getHandle*(name: cstring): PIhandle {.
   importc: "IupGetHandle", cdecl, dynlib: dllname.}
-proc SetHandle*(name: cstring, ih: PIhandle): PIhandle {.
+proc setHandle*(name: cstring, ih: PIhandle): PIhandle {.
   importc: "IupSetHandle", cdecl, dynlib: dllname.}
-proc GetAllNames*(names: cstringArray, n: cint): cint {.
+proc getAllNames*(names: cstringArray, n: cint): cint {.
   importc: "IupGetAllNames", cdecl, dynlib: dllname.}
-proc GetAllDialogs*(names: cstringArray, n: cint): cint {.
+proc getAllDialogs*(names: cstringArray, n: cint): cint {.
   importc: "IupGetAllDialogs", cdecl, dynlib: dllname.}
-proc GetName*(ih: PIhandle): cstring {.
+proc getName*(ih: PIhandle): cstring {.
   importc: "IupGetName", cdecl, dynlib: dllname.}
 
-proc SetAttributeHandle*(ih: PIhandle, name: cstring, ih_named: PIhandle) {.
+proc setAttributeHandle*(ih: PIhandle, name: cstring, ih_named: PIhandle) {.
   importc: "IupSetAttributeHandle", cdecl, dynlib: dllname.}
-proc GetAttributeHandle*(ih: PIhandle, name: cstring): PIhandle {.
+proc getAttributeHandle*(ih: PIhandle, name: cstring): PIhandle {.
   importc: "IupGetAttributeHandle", cdecl, dynlib: dllname.}
 
-proc GetClassName*(ih: PIhandle): cstring {.
+proc getClassName*(ih: PIhandle): cstring {.
   importc: "IupGetClassName", cdecl, dynlib: dllname.}
-proc GetClassType*(ih: PIhandle): cstring {.
+proc getClassType*(ih: PIhandle): cstring {.
   importc: "IupGetClassType", cdecl, dynlib: dllname.}
-proc GetClassAttributes*(classname: cstring, names: cstringArray, 
+proc getClassAttributes*(classname: cstring, names: cstringArray, 
                          n: cint): cint {.
   importc: "IupGetClassAttributes", cdecl, dynlib: dllname.}
-proc SaveClassAttributes*(ih: PIhandle) {.
+proc saveClassAttributes*(ih: PIhandle) {.
   importc: "IupSaveClassAttributes", cdecl, dynlib: dllname.}
-proc SetClassDefaultAttribute*(classname, name, value: cstring) {.
+proc setClassDefaultAttribute*(classname, name, value: cstring) {.
   importc: "IupSetClassDefaultAttribute", cdecl, dynlib: dllname.}
 
-proc Create*(classname: cstring): PIhandle {.
+proc create*(classname: cstring): PIhandle {.
   importc: "IupCreate", cdecl, dynlib: dllname.}
-proc Createv*(classname: cstring, params: pointer): PIhandle {.
+proc createv*(classname: cstring, params: pointer): PIhandle {.
   importc: "IupCreatev", cdecl, dynlib: dllname.}
-proc Createp*(classname: cstring, first: pointer): PIhandle {.
+proc createp*(classname: cstring, first: pointer): PIhandle {.
   importc: "IupCreatep", cdecl, dynlib: dllname, varargs.}
 
-proc Fill*(): PIhandle {.importc: "IupFill", cdecl, dynlib: dllname.}
-proc Radio*(child: PIhandle): PIhandle {.
+proc fill*(): PIhandle {.importc: "IupFill", cdecl, dynlib: dllname.}
+proc radio*(child: PIhandle): PIhandle {.
   importc: "IupRadio", cdecl, dynlib: dllname.}
-proc Vbox*(child: PIhandle): PIhandle {.
+proc vbox*(child: PIhandle): PIhandle {.
   importc: "IupVbox", cdecl, dynlib: dllname, varargs.}
-proc Vboxv*(children: ptr PIhandle): PIhandle {.
+proc vboxv*(children: ptr PIhandle): PIhandle {.
   importc: "IupVboxv", cdecl, dynlib: dllname.}
-proc Zbox*(child: PIhandle): PIhandle {.
+proc zbox*(child: PIhandle): PIhandle {.
   importc: "IupZbox", cdecl, dynlib: dllname, varargs.}
-proc Zboxv*(children: ptr PIhandle): PIhandle {.
+proc zboxv*(children: ptr PIhandle): PIhandle {.
   importc: "IupZboxv", cdecl, dynlib: dllname.}
-proc Hbox*(child: PIhandle): PIhandle {.
+proc hbox*(child: PIhandle): PIhandle {.
   importc: "IupHbox", cdecl, dynlib: dllname, varargs.}
-proc Hboxv*(children: ptr PIhandle): PIhandle {.
+proc hboxv*(children: ptr PIhandle): PIhandle {.
   importc: "IupHboxv", cdecl, dynlib: dllname.}
 
-proc Normalizer*(ih_first: PIhandle): PIhandle {.
+proc normalizer*(ih_first: PIhandle): PIhandle {.
   importc: "IupNormalizer", cdecl, dynlib: dllname, varargs.}
-proc Normalizerv*(ih_list: ptr PIhandle): PIhandle {.
+proc normalizerv*(ih_list: ptr PIhandle): PIhandle {.
   importc: "IupNormalizerv", cdecl, dynlib: dllname.}
 
-proc Cbox*(child: PIhandle): PIhandle {.
+proc cbox*(child: PIhandle): PIhandle {.
   importc: "IupCbox", cdecl, dynlib: dllname, varargs.}
-proc Cboxv*(children: ptr PIhandle): PIhandle {.
+proc cboxv*(children: ptr PIhandle): PIhandle {.
   importc: "IupCboxv", cdecl, dynlib: dllname.}
-proc Sbox*(child: PIhandle): PIhandle {.
+proc sbox*(child: PIhandle): PIhandle {.
   importc: "IupSbox", cdecl, dynlib: dllname.}
 
-proc Frame*(child: PIhandle): PIhandle {.
+proc frame*(child: PIhandle): PIhandle {.
   importc: "IupFrame", cdecl, dynlib: dllname.}
 
-proc Image*(width, height: cint, pixmap: pointer): PIhandle {.
+proc image*(width, height: cint, pixmap: pointer): PIhandle {.
   importc: "IupImage", cdecl, dynlib: dllname.}
-proc ImageRGB*(width, height: cint, pixmap: pointer): PIhandle {.
+proc imageRGB*(width, height: cint, pixmap: pointer): PIhandle {.
   importc: "IupImageRGB", cdecl, dynlib: dllname.}
-proc ImageRGBA*(width, height: cint, pixmap: pointer): PIhandle {.
+proc imageRGBA*(width, height: cint, pixmap: pointer): PIhandle {.
   importc: "IupImageRGBA", cdecl, dynlib: dllname.}
 
-proc Item*(title, action: cstring): PIhandle {.
+proc item*(title, action: cstring): PIhandle {.
   importc: "IupItem", cdecl, dynlib: dllname.}
-proc Submenu*(title: cstring, child: PIhandle): PIhandle {.
+proc submenu*(title: cstring, child: PIhandle): PIhandle {.
   importc: "IupSubmenu", cdecl, dynlib: dllname.}
-proc Separator*(): PIhandle {.
+proc separator*(): PIhandle {.
   importc: "IupSeparator", cdecl, dynlib: dllname.}
-proc Menu*(child: PIhandle): PIhandle {.
+proc menu*(child: PIhandle): PIhandle {.
   importc: "IupMenu", cdecl, dynlib: dllname, varargs.}
-proc Menuv*(children: ptr PIhandle): PIhandle {.
+proc menuv*(children: ptr PIhandle): PIhandle {.
   importc: "IupMenuv", cdecl, dynlib: dllname.}
 
-proc Button*(title, action: cstring): PIhandle {.
+proc button*(title, action: cstring): PIhandle {.
   importc: "IupButton", cdecl, dynlib: dllname.}
-proc Canvas*(action: cstring): PIhandle {.
+proc canvas*(action: cstring): PIhandle {.
   importc: "IupCanvas", cdecl, dynlib: dllname.}
-proc Dialog*(child: PIhandle): PIhandle {.
+proc dialog*(child: PIhandle): PIhandle {.
   importc: "IupDialog", cdecl, dynlib: dllname.}
-proc User*(): PIhandle {.
+proc user*(): PIhandle {.
   importc: "IupUser", cdecl, dynlib: dllname.}
-proc Label*(title: cstring): PIhandle {.
+proc label*(title: cstring): PIhandle {.
   importc: "IupLabel", cdecl, dynlib: dllname.}
-proc List*(action: cstring): PIhandle {.
+proc list*(action: cstring): PIhandle {.
   importc: "IupList", cdecl, dynlib: dllname.}
-proc Text*(action: cstring): PIhandle {.
+proc text*(action: cstring): PIhandle {.
   importc: "IupText", cdecl, dynlib: dllname.}
-proc MultiLine*(action: cstring): PIhandle {.
+proc multiLine*(action: cstring): PIhandle {.
   importc: "IupMultiLine", cdecl, dynlib: dllname.}
-proc Toggle*(title, action: cstring): PIhandle {.
+proc toggle*(title, action: cstring): PIhandle {.
   importc: "IupToggle", cdecl, dynlib: dllname.}
-proc Timer*(): PIhandle {.
+proc timer*(): PIhandle {.
   importc: "IupTimer", cdecl, dynlib: dllname.}
-proc ProgressBar*(): PIhandle {.
+proc progressBar*(): PIhandle {.
   importc: "IupProgressBar", cdecl, dynlib: dllname.}
-proc Val*(theType: cstring): PIhandle {.
+proc val*(theType: cstring): PIhandle {.
   importc: "IupVal", cdecl, dynlib: dllname.}
-proc Tabs*(child: PIhandle): PIhandle {.
+proc tabs*(child: PIhandle): PIhandle {.
   importc: "IupTabs", cdecl, dynlib: dllname, varargs.}
-proc Tabsv*(children: ptr PIhandle): PIhandle {.
+proc tabsv*(children: ptr PIhandle): PIhandle {.
   importc: "IupTabsv", cdecl, dynlib: dllname.}
-proc Tree*(): PIhandle {.importc: "IupTree", cdecl, dynlib: dllname.}
+proc tree*(): PIhandle {.importc: "IupTree", cdecl, dynlib: dllname.}
 
-proc Spin*(): PIhandle {.importc: "IupSpin", cdecl, dynlib: dllname.}
-proc Spinbox*(child: PIhandle): PIhandle {.
+proc spin*(): PIhandle {.importc: "IupSpin", cdecl, dynlib: dllname.}
+proc spinbox*(child: PIhandle): PIhandle {.
   importc: "IupSpinbox", cdecl, dynlib: dllname.}
 
 # IupText utilities
-proc TextConvertLinColToPos*(ih: PIhandle, lin, col: cint, pos: var cint) {.
+proc textConvertLinColToPos*(ih: PIhandle, lin, col: cint, pos: var cint) {.
   importc: "IupTextConvertLinColToPos", cdecl, dynlib: dllname.}
-proc TextConvertPosToLinCol*(ih: PIhandle, pos: cint, lin, col: var cint) {.
+proc textConvertPosToLinCol*(ih: PIhandle, pos: cint, lin, col: var cint) {.
   importc: "IupTextConvertPosToLinCol", cdecl, dynlib: dllname.}
 
-proc ConvertXYToPos*(ih: PIhandle, x, y: cint): cint {.
+proc convertXYToPos*(ih: PIhandle, x, y: cint): cint {.
   importc: "IupConvertXYToPos", cdecl, dynlib: dllname.}
 
 # IupTree utilities
-proc TreeSetUserId*(ih: PIhandle, id: cint, userid: pointer): cint {.
+proc treeSetUserId*(ih: PIhandle, id: cint, userid: pointer): cint {.
   importc: "IupTreeSetUserId", cdecl, dynlib: dllname, discardable.}
-proc TreeGetUserId*(ih: PIhandle, id: cint): pointer {.
+proc treeGetUserId*(ih: PIhandle, id: cint): pointer {.
   importc: "IupTreeGetUserId", cdecl, dynlib: dllname.}
-proc TreeGetId*(ih: PIhandle, userid: pointer): cint {.
+proc treeGetId*(ih: PIhandle, userid: pointer): cint {.
   importc: "IupTreeGetId", cdecl, dynlib: dllname.}
 
-proc TreeSetAttribute*(ih: PIhandle, name: cstring, id: cint, value: cstring) {.
+proc treeSetAttribute*(ih: PIhandle, name: cstring, id: cint, value: cstring) {.
   importc: "IupTreeSetAttribute", cdecl, dynlib: dllname.}
-proc TreeStoreAttribute*(ih: PIhandle, name: cstring, id: cint, value: cstring) {.
+proc treeStoreAttribute*(ih: PIhandle, name: cstring, id: cint, value: cstring) {.
   importc: "IupTreeStoreAttribute", cdecl, dynlib: dllname.}
-proc TreeGetAttribute*(ih: PIhandle, name: cstring, id: cint): cstring {.
+proc treeGetAttribute*(ih: PIhandle, name: cstring, id: cint): cstring {.
   importc: "IupTreeGetAttribute", cdecl, dynlib: dllname.}
-proc TreeGetInt*(ih: PIhandle, name: cstring, id: cint): cint {.
+proc treeGetInt*(ih: PIhandle, name: cstring, id: cint): cint {.
   importc: "IupTreeGetInt", cdecl, dynlib: dllname.}
-proc TreeGetFloat*(ih: PIhandle, name: cstring, id: cint): cfloat {.
+proc treeGetFloat*(ih: PIhandle, name: cstring, id: cint): cfloat {.
   importc: "IupTreeGetFloat", cdecl, dynlib: dllname.}
-proc TreeSetfAttribute*(ih: PIhandle, name: cstring, id: cint, format: cstring) {.
+proc treeSetfAttribute*(ih: PIhandle, name: cstring, id: cint, format: cstring) {.
   importc: "IupTreeSetfAttribute", cdecl, dynlib: dllname, varargs.}
 
 
@@ -552,360 +552,360 @@ proc isCtrlXkey*(c: cint): bool = return c > 512 and c < 768
 proc isAltXkey*(c: cint): bool = return c > 768 and c < 1024

 proc isSysXkey*(c: cint): bool = return c > 1024 and c < 1280

 

-proc IUPxCODE*(c: cint): cint = return c + cint(128) # Normal (must be above 128)

-proc IUPsxCODE*(c: cint): cint = 
+proc iUPxCODE*(c: cint): cint = return c + cint(128) # Normal (must be above 128)

+proc iUPsxCODE*(c: cint): cint = 
   return c + cint(256)
   # Shift (must have range to include the standard keys and the normal 
   # extended keys, so must be above 256
 
-proc IUPcxCODE*(c: cint): cint = return c + cint(512) # Ctrl

-proc IUPmxCODE*(c: cint): cint = return c + cint(768) # Alt

-proc IUPyxCODE*(c: cint): cint = return c + cint(1024) # Sys (Win or Apple) 

+proc iUPcxCODE*(c: cint): cint = return c + cint(512) # Ctrl

+proc iUPmxCODE*(c: cint): cint = return c + cint(768) # Alt

+proc iUPyxCODE*(c: cint): cint = return c + cint(1024) # Sys (Win or Apple) 

 
 const

   IUP_NUMMAXCODES* = 1280 ## 5*256=1280  Normal+Shift+Ctrl+Alt+Sys

 

-  K_HOME* = IUPxCODE(1)                

-  K_UP* = IUPxCODE(2)

-  K_PGUP* = IUPxCODE(3)

-  K_LEFT* = IUPxCODE(4)

-  K_MIDDLE* = IUPxCODE(5)

-  K_RIGHT* = IUPxCODE(6)

-  K_END* = IUPxCODE(7)

-  K_DOWN* = IUPxCODE(8)

-  K_PGDN* = IUPxCODE(9)

-  K_INS* = IUPxCODE(10)    

-  K_DEL* = IUPxCODE(11)    

-  K_PAUSE* = IUPxCODE(12)

-  K_ESC* = IUPxCODE(13)

-  K_ccedilla* = IUPxCODE(14)

-  K_F1* = IUPxCODE(15)

-  K_F2* = IUPxCODE(16)

-  K_F3* = IUPxCODE(17)

-  K_F4* = IUPxCODE(18)

-  K_F5* = IUPxCODE(19)

-  K_F6* = IUPxCODE(20)

-  K_F7* = IUPxCODE(21)

-  K_F8* = IUPxCODE(22)

-  K_F9* = IUPxCODE(23)

-  K_F10* = IUPxCODE(24)

-  K_F11* = IUPxCODE(25)

-  K_F12* = IUPxCODE(26)

-  K_Print* = IUPxCODE(27)

-  K_Menu* = IUPxCODE(28)

+  K_HOME* = iupxCODE(1)                

+  K_UP* = iupxCODE(2)

+  K_PGUP* = iupxCODE(3)

+  K_LEFT* = iupxCODE(4)

+  K_MIDDLE* = iupxCODE(5)

+  K_RIGHT* = iupxCODE(6)

+  K_END* = iupxCODE(7)

+  K_DOWN* = iupxCODE(8)

+  K_PGDN* = iupxCODE(9)

+  K_INS* = iupxCODE(10)    

+  K_DEL* = iupxCODE(11)    

+  K_PAUSE* = iupxCODE(12)

+  K_ESC* = iupxCODE(13)

+  K_ccedilla* = iupxCODE(14)

+  K_F1* = iupxCODE(15)

+  K_F2* = iupxCODE(16)

+  K_F3* = iupxCODE(17)

+  K_F4* = iupxCODE(18)

+  K_F5* = iupxCODE(19)

+  K_F6* = iupxCODE(20)

+  K_F7* = iupxCODE(21)

+  K_F8* = iupxCODE(22)

+  K_F9* = iupxCODE(23)

+  K_F10* = iupxCODE(24)

+  K_F11* = iupxCODE(25)

+  K_F12* = iupxCODE(26)

+  K_Print* = iupxCODE(27)

+  K_Menu* = iupxCODE(28)

 

-  K_acute* = IUPxCODE(29) # no Shift/Ctrl/Alt

+  K_acute* = iupxCODE(29) # no Shift/Ctrl/Alt

 

-  K_sHOME* = IUPsxCODE(K_HOME)

-  K_sUP* = IUPsxCODE(K_UP)

-  K_sPGUP* = IUPsxCODE(K_PGUP)

-  K_sLEFT* = IUPsxCODE(K_LEFT)

-  K_sMIDDLE* = IUPsxCODE(K_MIDDLE)

-  K_sRIGHT* = IUPsxCODE(K_RIGHT)

-  K_sEND* = IUPsxCODE(K_END)

-  K_sDOWN* = IUPsxCODE(K_DOWN)

-  K_sPGDN* = IUPsxCODE(K_PGDN)

-  K_sINS* = IUPsxCODE(K_INS)

-  K_sDEL* = IUPsxCODE(K_DEL)

-  K_sSP* = IUPsxCODE(K_SP)

-  K_sTAB* = IUPsxCODE(K_TAB)

-  K_sCR* = IUPsxCODE(K_CR)

-  K_sBS* = IUPsxCODE(K_BS)

-  K_sPAUSE* = IUPsxCODE(K_PAUSE)

-  K_sESC* = IUPsxCODE(K_ESC)

-  K_sCcedilla* = IUPsxCODE(K_ccedilla)

-  K_sF1* = IUPsxCODE(K_F1)

-  K_sF2* = IUPsxCODE(K_F2)

-  K_sF3* = IUPsxCODE(K_F3)

-  K_sF4* = IUPsxCODE(K_F4)

-  K_sF5* = IUPsxCODE(K_F5)

-  K_sF6* = IUPsxCODE(K_F6)

-  K_sF7* = IUPsxCODE(K_F7)

-  K_sF8* = IUPsxCODE(K_F8)

-  K_sF9* = IUPsxCODE(K_F9)

-  K_sF10* = IUPsxCODE(K_F10)

-  K_sF11* = IUPsxCODE(K_F11)

-  K_sF12* = IUPsxCODE(K_F12)

-  K_sPrint* = IUPsxCODE(K_Print)

-  K_sMenu* = IUPsxCODE(K_Menu)

+  K_sHOME* = iUPsxCODE(K_HOME)

+  K_sUP* = iUPsxCODE(K_UP)

+  K_sPGUP* = iUPsxCODE(K_PGUP)

+  K_sLEFT* = iUPsxCODE(K_LEFT)

+  K_sMIDDLE* = iUPsxCODE(K_MIDDLE)

+  K_sRIGHT* = iUPsxCODE(K_RIGHT)

+  K_sEND* = iUPsxCODE(K_END)

+  K_sDOWN* = iUPsxCODE(K_DOWN)

+  K_sPGDN* = iUPsxCODE(K_PGDN)

+  K_sINS* = iUPsxCODE(K_INS)

+  K_sDEL* = iUPsxCODE(K_DEL)

+  K_sSP* = iUPsxCODE(K_SP)

+  K_sTAB* = iUPsxCODE(K_TAB)

+  K_sCR* = iUPsxCODE(K_CR)

+  K_sBS* = iUPsxCODE(K_BS)

+  K_sPAUSE* = iUPsxCODE(K_PAUSE)

+  K_sESC* = iUPsxCODE(K_ESC)

+  K_sCcedilla* = iUPsxCODE(K_ccedilla)

+  K_sF1* = iUPsxCODE(K_F1)

+  K_sF2* = iUPsxCODE(K_F2)

+  K_sF3* = iUPsxCODE(K_F3)

+  K_sF4* = iUPsxCODE(K_F4)

+  K_sF5* = iUPsxCODE(K_F5)

+  K_sF6* = iUPsxCODE(K_F6)

+  K_sF7* = iUPsxCODE(K_F7)

+  K_sF8* = iUPsxCODE(K_F8)

+  K_sF9* = iUPsxCODE(K_F9)

+  K_sF10* = iUPsxCODE(K_F10)

+  K_sF11* = iUPsxCODE(K_F11)

+  K_sF12* = iUPsxCODE(K_F12)

+  K_sPrint* = iUPsxCODE(K_Print)

+  K_sMenu* = iUPsxCODE(K_Menu)

 

-  K_cHOME* = IUPcxCODE(K_HOME)

-  K_cUP* = IUPcxCODE(K_UP)

-  K_cPGUP* = IUPcxCODE(K_PGUP)

-  K_cLEFT* = IUPcxCODE(K_LEFT)

-  K_cMIDDLE* = IUPcxCODE(K_MIDDLE)

-  K_cRIGHT* = IUPcxCODE(K_RIGHT)

-  K_cEND* = IUPcxCODE(K_END)

-  K_cDOWN* = IUPcxCODE(K_DOWN)

-  K_cPGDN* = IUPcxCODE(K_PGDN)

-  K_cINS* = IUPcxCODE(K_INS)

-  K_cDEL* = IUPcxCODE(K_DEL)

-  K_cSP* = IUPcxCODE(K_SP)

-  K_cTAB* = IUPcxCODE(K_TAB)

-  K_cCR* = IUPcxCODE(K_CR)

-  K_cBS* = IUPcxCODE(K_BS)

-  K_cPAUSE* = IUPcxCODE(K_PAUSE)

-  K_cESC* = IUPcxCODE(K_ESC)

-  K_cCcedilla* = IUPcxCODE(K_ccedilla)

-  K_cF1* = IUPcxCODE(K_F1)

-  K_cF2* = IUPcxCODE(K_F2)

-  K_cF3* = IUPcxCODE(K_F3)

-  K_cF4* = IUPcxCODE(K_F4)

-  K_cF5* = IUPcxCODE(K_F5)

-  K_cF6* = IUPcxCODE(K_F6)

-  K_cF7* = IUPcxCODE(K_F7)

-  K_cF8* = IUPcxCODE(K_F8)

-  K_cF9* = IUPcxCODE(K_F9)

-  K_cF10* = IUPcxCODE(K_F10)

-  K_cF11* = IUPcxCODE(K_F11)

-  K_cF12* = IUPcxCODE(K_F12)

-  K_cPrint* = IUPcxCODE(K_Print)

-  K_cMenu* = IUPcxCODE(K_Menu)

+  K_cHOME* = iUPcxCODE(K_HOME)

+  K_cUP* = iUPcxCODE(K_UP)

+  K_cPGUP* = iUPcxCODE(K_PGUP)

+  K_cLEFT* = iUPcxCODE(K_LEFT)

+  K_cMIDDLE* = iUPcxCODE(K_MIDDLE)

+  K_cRIGHT* = iUPcxCODE(K_RIGHT)

+  K_cEND* = iUPcxCODE(K_END)

+  K_cDOWN* = iUPcxCODE(K_DOWN)

+  K_cPGDN* = iUPcxCODE(K_PGDN)

+  K_cINS* = iUPcxCODE(K_INS)

+  K_cDEL* = iUPcxCODE(K_DEL)

+  K_cSP* = iUPcxCODE(K_SP)

+  K_cTAB* = iUPcxCODE(K_TAB)

+  K_cCR* = iUPcxCODE(K_CR)

+  K_cBS* = iUPcxCODE(K_BS)

+  K_cPAUSE* = iUPcxCODE(K_PAUSE)

+  K_cESC* = iUPcxCODE(K_ESC)

+  K_cCcedilla* = iUPcxCODE(K_ccedilla)

+  K_cF1* = iUPcxCODE(K_F1)

+  K_cF2* = iUPcxCODE(K_F2)

+  K_cF3* = iUPcxCODE(K_F3)

+  K_cF4* = iUPcxCODE(K_F4)

+  K_cF5* = iUPcxCODE(K_F5)

+  K_cF6* = iUPcxCODE(K_F6)

+  K_cF7* = iUPcxCODE(K_F7)

+  K_cF8* = iUPcxCODE(K_F8)

+  K_cF9* = iUPcxCODE(K_F9)

+  K_cF10* = iUPcxCODE(K_F10)

+  K_cF11* = iUPcxCODE(K_F11)

+  K_cF12* = iUPcxCODE(K_F12)

+  K_cPrint* = iUPcxCODE(K_Print)

+  K_cMenu* = iUPcxCODE(K_Menu)

 

-  K_mHOME* = IUPmxCODE(K_HOME)

-  K_mUP* = IUPmxCODE(K_UP)

-  K_mPGUP* = IUPmxCODE(K_PGUP)

-  K_mLEFT* = IUPmxCODE(K_LEFT)

-  K_mMIDDLE* = IUPmxCODE(K_MIDDLE)

-  K_mRIGHT* = IUPmxCODE(K_RIGHT)

-  K_mEND* = IUPmxCODE(K_END)

-  K_mDOWN* = IUPmxCODE(K_DOWN)

-  K_mPGDN* = IUPmxCODE(K_PGDN)

-  K_mINS* = IUPmxCODE(K_INS)

-  K_mDEL* = IUPmxCODE(K_DEL)

-  K_mSP* = IUPmxCODE(K_SP)

-  K_mTAB* = IUPmxCODE(K_TAB)

-  K_mCR* = IUPmxCODE(K_CR)

-  K_mBS* = IUPmxCODE(K_BS)

-  K_mPAUSE* = IUPmxCODE(K_PAUSE)

-  K_mESC* = IUPmxCODE(K_ESC)

-  K_mCcedilla* = IUPmxCODE(K_ccedilla)

-  K_mF1* = IUPmxCODE(K_F1)

-  K_mF2* = IUPmxCODE(K_F2)

-  K_mF3* = IUPmxCODE(K_F3)

-  K_mF4* = IUPmxCODE(K_F4)

-  K_mF5* = IUPmxCODE(K_F5)

-  K_mF6* = IUPmxCODE(K_F6)

-  K_mF7* = IUPmxCODE(K_F7)

-  K_mF8* = IUPmxCODE(K_F8)

-  K_mF9* = IUPmxCODE(K_F9)

-  K_mF10* = IUPmxCODE(K_F10)

-  K_mF11* = IUPmxCODE(K_F11)

-  K_mF12* = IUPmxCODE(K_F12)

-  K_mPrint* = IUPmxCODE(K_Print)

-  K_mMenu* = IUPmxCODE(K_Menu)

+  K_mHOME* = iUPmxCODE(K_HOME)

+  K_mUP* = iUPmxCODE(K_UP)

+  K_mPGUP* = iUPmxCODE(K_PGUP)

+  K_mLEFT* = iUPmxCODE(K_LEFT)

+  K_mMIDDLE* = iUPmxCODE(K_MIDDLE)

+  K_mRIGHT* = iUPmxCODE(K_RIGHT)

+  K_mEND* = iUPmxCODE(K_END)

+  K_mDOWN* = iUPmxCODE(K_DOWN)

+  K_mPGDN* = iUPmxCODE(K_PGDN)

+  K_mINS* = iUPmxCODE(K_INS)

+  K_mDEL* = iUPmxCODE(K_DEL)

+  K_mSP* = iUPmxCODE(K_SP)

+  K_mTAB* = iUPmxCODE(K_TAB)

+  K_mCR* = iUPmxCODE(K_CR)

+  K_mBS* = iUPmxCODE(K_BS)

+  K_mPAUSE* = iUPmxCODE(K_PAUSE)

+  K_mESC* = iUPmxCODE(K_ESC)

+  K_mCcedilla* = iUPmxCODE(K_ccedilla)

+  K_mF1* = iUPmxCODE(K_F1)

+  K_mF2* = iUPmxCODE(K_F2)

+  K_mF3* = iUPmxCODE(K_F3)

+  K_mF4* = iUPmxCODE(K_F4)

+  K_mF5* = iUPmxCODE(K_F5)

+  K_mF6* = iUPmxCODE(K_F6)

+  K_mF7* = iUPmxCODE(K_F7)

+  K_mF8* = iUPmxCODE(K_F8)

+  K_mF9* = iUPmxCODE(K_F9)

+  K_mF10* = iUPmxCODE(K_F10)

+  K_mF11* = iUPmxCODE(K_F11)

+  K_mF12* = iUPmxCODE(K_F12)

+  K_mPrint* = iUPmxCODE(K_Print)

+  K_mMenu* = iUPmxCODE(K_Menu)

 

-  K_yHOME* = IUPyxCODE(K_HOME)

-  K_yUP* = IUPyxCODE(K_UP)

-  K_yPGUP* = IUPyxCODE(K_PGUP)

-  K_yLEFT* = IUPyxCODE(K_LEFT)

-  K_yMIDDLE* = IUPyxCODE(K_MIDDLE)

-  K_yRIGHT* = IUPyxCODE(K_RIGHT)

-  K_yEND* = IUPyxCODE(K_END)

-  K_yDOWN* = IUPyxCODE(K_DOWN)

-  K_yPGDN* = IUPyxCODE(K_PGDN)

-  K_yINS* = IUPyxCODE(K_INS)

-  K_yDEL* = IUPyxCODE(K_DEL)

-  K_ySP* = IUPyxCODE(K_SP)

-  K_yTAB* = IUPyxCODE(K_TAB)

-  K_yCR* = IUPyxCODE(K_CR)

-  K_yBS* = IUPyxCODE(K_BS)

-  K_yPAUSE* = IUPyxCODE(K_PAUSE)

-  K_yESC* = IUPyxCODE(K_ESC)

-  K_yCcedilla* = IUPyxCODE(K_ccedilla)

-  K_yF1* = IUPyxCODE(K_F1)

-  K_yF2* = IUPyxCODE(K_F2)

-  K_yF3* = IUPyxCODE(K_F3)

-  K_yF4* = IUPyxCODE(K_F4)

-  K_yF5* = IUPyxCODE(K_F5)

-  K_yF6* = IUPyxCODE(K_F6)

-  K_yF7* = IUPyxCODE(K_F7)

-  K_yF8* = IUPyxCODE(K_F8)

-  K_yF9* = IUPyxCODE(K_F9)

-  K_yF10* = IUPyxCODE(K_F10)

-  K_yF11* = IUPyxCODE(K_F11)

-  K_yF12* = IUPyxCODE(K_F12)

-  K_yPrint* = IUPyxCODE(K_Print)

-  K_yMenu* = IUPyxCODE(K_Menu)

+  K_yHOME* = iUPyxCODE(K_HOME)

+  K_yUP* = iUPyxCODE(K_UP)

+  K_yPGUP* = iUPyxCODE(K_PGUP)

+  K_yLEFT* = iUPyxCODE(K_LEFT)

+  K_yMIDDLE* = iUPyxCODE(K_MIDDLE)

+  K_yRIGHT* = iUPyxCODE(K_RIGHT)

+  K_yEND* = iUPyxCODE(K_END)

+  K_yDOWN* = iUPyxCODE(K_DOWN)

+  K_yPGDN* = iUPyxCODE(K_PGDN)

+  K_yINS* = iUPyxCODE(K_INS)

+  K_yDEL* = iUPyxCODE(K_DEL)

+  K_ySP* = iUPyxCODE(K_SP)

+  K_yTAB* = iUPyxCODE(K_TAB)

+  K_yCR* = iUPyxCODE(K_CR)

+  K_yBS* = iUPyxCODE(K_BS)

+  K_yPAUSE* = iUPyxCODE(K_PAUSE)

+  K_yESC* = iUPyxCODE(K_ESC)

+  K_yCcedilla* = iUPyxCODE(K_ccedilla)

+  K_yF1* = iUPyxCODE(K_F1)

+  K_yF2* = iUPyxCODE(K_F2)

+  K_yF3* = iUPyxCODE(K_F3)

+  K_yF4* = iUPyxCODE(K_F4)

+  K_yF5* = iUPyxCODE(K_F5)

+  K_yF6* = iUPyxCODE(K_F6)

+  K_yF7* = iUPyxCODE(K_F7)

+  K_yF8* = iUPyxCODE(K_F8)

+  K_yF9* = iUPyxCODE(K_F9)

+  K_yF10* = iUPyxCODE(K_F10)

+  K_yF11* = iUPyxCODE(K_F11)

+  K_yF12* = iUPyxCODE(K_F12)

+  K_yPrint* = iUPyxCODE(K_Print)

+  K_yMenu* = iUPyxCODE(K_Menu)

 

-  K_sPlus* = IUPsxCODE(K_plus)   

-  K_sComma* = IUPsxCODE(K_comma)   

-  K_sMinus* = IUPsxCODE(K_minus)   

-  K_sPeriod* = IUPsxCODE(K_period)   

-  K_sSlash* = IUPsxCODE(K_slash)   

-  K_sAsterisk* = IUPsxCODE(K_asterisk)

+  K_sPlus* = iUPsxCODE(K_plus)   

+  K_sComma* = iUPsxCODE(K_comma)   

+  K_sMinus* = iUPsxCODE(K_minus)   

+  K_sPeriod* = iUPsxCODE(K_period)   

+  K_sSlash* = iUPsxCODE(K_slash)   

+  K_sAsterisk* = iUPsxCODE(K_asterisk)

                         

-  K_cupperA* = IUPcxCODE(K_upperA)

-  K_cupperB* = IUPcxCODE(K_upperB)

-  K_cupperC* = IUPcxCODE(K_upperC)

-  K_cupperD* = IUPcxCODE(K_upperD)

-  K_cupperE* = IUPcxCODE(K_upperE)

-  K_cupperF* = IUPcxCODE(K_upperF)

-  K_cupperG* = IUPcxCODE(K_upperG)

-  K_cupperH* = IUPcxCODE(K_upperH)

-  K_cupperI* = IUPcxCODE(K_upperI)

-  K_cupperJ* = IUPcxCODE(K_upperJ)

-  K_cupperK* = IUPcxCODE(K_upperK)

-  K_cupperL* = IUPcxCODE(K_upperL)

-  K_cupperM* = IUPcxCODE(K_upperM)

-  K_cupperN* = IUPcxCODE(K_upperN)

-  K_cupperO* = IUPcxCODE(K_upperO)

-  K_cupperP* = IUPcxCODE(K_upperP)

-  K_cupperQ* = IUPcxCODE(K_upperQ)

-  K_cupperR* = IUPcxCODE(K_upperR)

-  K_cupperS* = IUPcxCODE(K_upperS)

-  K_cupperT* = IUPcxCODE(K_upperT)

-  K_cupperU* = IUPcxCODE(K_upperU)

-  K_cupperV* = IUPcxCODE(K_upperV)

-  K_cupperW* = IUPcxCODE(K_upperW)

-  K_cupperX* = IUPcxCODE(K_upperX)

-  K_cupperY* = IUPcxCODE(K_upperY)

-  K_cupperZ* = IUPcxCODE(K_upperZ)

-  K_c1* = IUPcxCODE(K_1)

-  K_c2* = IUPcxCODE(K_2)

-  K_c3* = IUPcxCODE(K_3)

-  K_c4* = IUPcxCODE(K_4)

-  K_c5* = IUPcxCODE(K_5)

-  K_c6* = IUPcxCODE(K_6)

-  K_c7* = IUPcxCODE(K_7)        

-  K_c8* = IUPcxCODE(K_8)         

-  K_c9* = IUPcxCODE(K_9)

-  K_c0* = IUPcxCODE(K_0)

-  K_cPlus* = IUPcxCODE(K_plus)   

-  K_cComma* = IUPcxCODE(K_comma)   

-  K_cMinus* = IUPcxCODE(K_minus)   

-  K_cPeriod* = IUPcxCODE(K_period)   

-  K_cSlash* = IUPcxCODE(K_slash)   

-  K_cSemicolon* = IUPcxCODE(K_semicolon) 

-  K_cEqual* = IUPcxCODE(K_equal)

-  K_cBracketleft* = IUPcxCODE(K_bracketleft)

-  K_cBracketright* = IUPcxCODE(K_bracketright)

-  K_cBackslash* = IUPcxCODE(K_backslash)

-  K_cAsterisk* = IUPcxCODE(K_asterisk)

+  K_cupperA* = iUPcxCODE(K_upperA)

+  K_cupperB* = iUPcxCODE(K_upperB)

+  K_cupperC* = iUPcxCODE(K_upperC)

+  K_cupperD* = iUPcxCODE(K_upperD)

+  K_cupperE* = iUPcxCODE(K_upperE)

+  K_cupperF* = iUPcxCODE(K_upperF)

+  K_cupperG* = iUPcxCODE(K_upperG)

+  K_cupperH* = iUPcxCODE(K_upperH)

+  K_cupperI* = iUPcxCODE(K_upperI)

+  K_cupperJ* = iUPcxCODE(K_upperJ)

+  K_cupperK* = iUPcxCODE(K_upperK)

+  K_cupperL* = iUPcxCODE(K_upperL)

+  K_cupperM* = iUPcxCODE(K_upperM)

+  K_cupperN* = iUPcxCODE(K_upperN)

+  K_cupperO* = iUPcxCODE(K_upperO)

+  K_cupperP* = iUPcxCODE(K_upperP)

+  K_cupperQ* = iUPcxCODE(K_upperQ)

+  K_cupperR* = iUPcxCODE(K_upperR)

+  K_cupperS* = iUPcxCODE(K_upperS)

+  K_cupperT* = iUPcxCODE(K_upperT)

+  K_cupperU* = iUPcxCODE(K_upperU)

+  K_cupperV* = iUPcxCODE(K_upperV)

+  K_cupperW* = iUPcxCODE(K_upperW)

+  K_cupperX* = iUPcxCODE(K_upperX)

+  K_cupperY* = iUPcxCODE(K_upperY)

+  K_cupperZ* = iUPcxCODE(K_upperZ)

+  K_c1* = iUPcxCODE(K_1)

+  K_c2* = iUPcxCODE(K_2)

+  K_c3* = iUPcxCODE(K_3)

+  K_c4* = iUPcxCODE(K_4)

+  K_c5* = iUPcxCODE(K_5)

+  K_c6* = iUPcxCODE(K_6)

+  K_c7* = iUPcxCODE(K_7)        

+  K_c8* = iUPcxCODE(K_8)         

+  K_c9* = iUPcxCODE(K_9)

+  K_c0* = iUPcxCODE(K_0)

+  K_cPlus* = iUPcxCODE(K_plus)   

+  K_cComma* = iUPcxCODE(K_comma)   

+  K_cMinus* = iUPcxCODE(K_minus)   

+  K_cPeriod* = iUPcxCODE(K_period)   

+  K_cSlash* = iUPcxCODE(K_slash)   

+  K_cSemicolon* = iUPcxCODE(K_semicolon) 

+  K_cEqual* = iUPcxCODE(K_equal)

+  K_cBracketleft* = iUPcxCODE(K_bracketleft)

+  K_cBracketright* = iUPcxCODE(K_bracketright)

+  K_cBackslash* = iUPcxCODE(K_backslash)

+  K_cAsterisk* = iUPcxCODE(K_asterisk)

 

-  K_mupperA* = IUPmxCODE(K_upperA)

-  K_mupperB* = IUPmxCODE(K_upperB)

-  K_mupperC* = IUPmxCODE(K_upperC)

-  K_mupperD* = IUPmxCODE(K_upperD)

-  K_mupperE* = IUPmxCODE(K_upperE)

-  K_mupperF* = IUPmxCODE(K_upperF)

-  K_mupperG* = IUPmxCODE(K_upperG)

-  K_mupperH* = IUPmxCODE(K_upperH)

-  K_mupperI* = IUPmxCODE(K_upperI)

-  K_mupperJ* = IUPmxCODE(K_upperJ)

-  K_mupperK* = IUPmxCODE(K_upperK)

-  K_mupperL* = IUPmxCODE(K_upperL)

-  K_mupperM* = IUPmxCODE(K_upperM)

-  K_mupperN* = IUPmxCODE(K_upperN)

-  K_mupperO* = IUPmxCODE(K_upperO)

-  K_mupperP* = IUPmxCODE(K_upperP)

-  K_mupperQ* = IUPmxCODE(K_upperQ)

-  K_mupperR* = IUPmxCODE(K_upperR)

-  K_mupperS* = IUPmxCODE(K_upperS)

-  K_mupperT* = IUPmxCODE(K_upperT)

-  K_mupperU* = IUPmxCODE(K_upperU)

-  K_mupperV* = IUPmxCODE(K_upperV)

-  K_mupperW* = IUPmxCODE(K_upperW)

-  K_mupperX* = IUPmxCODE(K_upperX)

-  K_mupperY* = IUPmxCODE(K_upperY)

-  K_mupperZ* = IUPmxCODE(K_upperZ)

-  K_m1* = IUPmxCODE(K_1)

-  K_m2* = IUPmxCODE(K_2)

-  K_m3* = IUPmxCODE(K_3)

-  K_m4* = IUPmxCODE(K_4)

-  K_m5* = IUPmxCODE(K_5)

-  K_m6* = IUPmxCODE(K_6)

-  K_m7* = IUPmxCODE(K_7)        

-  K_m8* = IUPmxCODE(K_8)         

-  K_m9* = IUPmxCODE(K_9)

-  K_m0* = IUPmxCODE(K_0)

-  K_mPlus* = IUPmxCODE(K_plus)   

-  K_mComma* = IUPmxCODE(K_comma)   

-  K_mMinus* = IUPmxCODE(K_minus)   

-  K_mPeriod* = IUPmxCODE(K_period)   

-  K_mSlash* = IUPmxCODE(K_slash)   

-  K_mSemicolon* = IUPmxCODE(K_semicolon) 

-  K_mEqual* = IUPmxCODE(K_equal)

-  K_mBracketleft* = IUPmxCODE(K_bracketleft)

-  K_mBracketright* = IUPmxCODE(K_bracketright)

-  K_mBackslash* = IUPmxCODE(K_backslash)

-  K_mAsterisk* = IUPmxCODE(K_asterisk)

+  K_mupperA* = iUPmxCODE(K_upperA)

+  K_mupperB* = iUPmxCODE(K_upperB)

+  K_mupperC* = iUPmxCODE(K_upperC)

+  K_mupperD* = iUPmxCODE(K_upperD)

+  K_mupperE* = iUPmxCODE(K_upperE)

+  K_mupperF* = iUPmxCODE(K_upperF)

+  K_mupperG* = iUPmxCODE(K_upperG)

+  K_mupperH* = iUPmxCODE(K_upperH)

+  K_mupperI* = iUPmxCODE(K_upperI)

+  K_mupperJ* = iUPmxCODE(K_upperJ)

+  K_mupperK* = iUPmxCODE(K_upperK)

+  K_mupperL* = iUPmxCODE(K_upperL)

+  K_mupperM* = iUPmxCODE(K_upperM)

+  K_mupperN* = iUPmxCODE(K_upperN)

+  K_mupperO* = iUPmxCODE(K_upperO)

+  K_mupperP* = iUPmxCODE(K_upperP)

+  K_mupperQ* = iUPmxCODE(K_upperQ)

+  K_mupperR* = iUPmxCODE(K_upperR)

+  K_mupperS* = iUPmxCODE(K_upperS)

+  K_mupperT* = iUPmxCODE(K_upperT)

+  K_mupperU* = iUPmxCODE(K_upperU)

+  K_mupperV* = iUPmxCODE(K_upperV)

+  K_mupperW* = iUPmxCODE(K_upperW)

+  K_mupperX* = iUPmxCODE(K_upperX)

+  K_mupperY* = iUPmxCODE(K_upperY)

+  K_mupperZ* = iUPmxCODE(K_upperZ)

+  K_m1* = iUPmxCODE(K_1)

+  K_m2* = iUPmxCODE(K_2)

+  K_m3* = iUPmxCODE(K_3)

+  K_m4* = iUPmxCODE(K_4)

+  K_m5* = iUPmxCODE(K_5)

+  K_m6* = iUPmxCODE(K_6)

+  K_m7* = iUPmxCODE(K_7)        

+  K_m8* = iUPmxCODE(K_8)         

+  K_m9* = iUPmxCODE(K_9)

+  K_m0* = iUPmxCODE(K_0)

+  K_mPlus* = iUPmxCODE(K_plus)   

+  K_mComma* = iUPmxCODE(K_comma)   

+  K_mMinus* = iUPmxCODE(K_minus)   

+  K_mPeriod* = iUPmxCODE(K_period)   

+  K_mSlash* = iUPmxCODE(K_slash)   

+  K_mSemicolon* = iUPmxCODE(K_semicolon) 

+  K_mEqual* = iUPmxCODE(K_equal)

+  K_mBracketleft* = iUPmxCODE(K_bracketleft)

+  K_mBracketright* = iUPmxCODE(K_bracketright)

+  K_mBackslash* = iUPmxCODE(K_backslash)

+  K_mAsterisk* = iUPmxCODE(K_asterisk)

 

-  K_yA* = IUPyxCODE(K_upperA)

-  K_yB* = IUPyxCODE(K_upperB)

-  K_yC* = IUPyxCODE(K_upperC)

-  K_yD* = IUPyxCODE(K_upperD)

-  K_yE* = IUPyxCODE(K_upperE)

-  K_yF* = IUPyxCODE(K_upperF)

-  K_yG* = IUPyxCODE(K_upperG)

-  K_yH* = IUPyxCODE(K_upperH)

-  K_yI* = IUPyxCODE(K_upperI)

-  K_yJ* = IUPyxCODE(K_upperJ)

-  K_yK* = IUPyxCODE(K_upperK)

-  K_yL* = IUPyxCODE(K_upperL)

-  K_yM* = IUPyxCODE(K_upperM)

-  K_yN* = IUPyxCODE(K_upperN)

-  K_yO* = IUPyxCODE(K_upperO)

-  K_yP* = IUPyxCODE(K_upperP)

-  K_yQ* = IUPyxCODE(K_upperQ)

-  K_yR* = IUPyxCODE(K_upperR)

-  K_yS* = IUPyxCODE(K_upperS)

-  K_yT* = IUPyxCODE(K_upperT)

-  K_yU* = IUPyxCODE(K_upperU)

-  K_yV* = IUPyxCODE(K_upperV)

-  K_yW* = IUPyxCODE(K_upperW)

-  K_yX* = IUPyxCODE(K_upperX)

-  K_yY* = IUPyxCODE(K_upperY)

-  K_yZ* = IUPyxCODE(K_upperZ)

-  K_y1* = IUPyxCODE(K_1)

-  K_y2* = IUPyxCODE(K_2)

-  K_y3* = IUPyxCODE(K_3)

-  K_y4* = IUPyxCODE(K_4)

-  K_y5* = IUPyxCODE(K_5)

-  K_y6* = IUPyxCODE(K_6)

-  K_y7* = IUPyxCODE(K_7)        

-  K_y8* = IUPyxCODE(K_8)         

-  K_y9* = IUPyxCODE(K_9)

-  K_y0* = IUPyxCODE(K_0)

-  K_yPlus* = IUPyxCODE(K_plus)

-  K_yComma* = IUPyxCODE(K_comma)

-  K_yMinus* = IUPyxCODE(K_minus)   

-  K_yPeriod* = IUPyxCODE(K_period)   

-  K_ySlash* = IUPyxCODE(K_slash)   

-  K_ySemicolon* = IUPyxCODE(K_semicolon) 

-  K_yEqual* = IUPyxCODE(K_equal)

-  K_yBracketleft* = IUPyxCODE(K_bracketleft)

-  K_yBracketright* = IUPyxCODE(K_bracketright)

-  K_yBackslash* = IUPyxCODE(K_backslash)

-  K_yAsterisk* = IUPyxCODE(K_asterisk)

-
-proc ControlsOpen*(): cint {.cdecl, importc: "IupControlsOpen", dynlib: dllname.}

-proc ControlsClose*() {.cdecl, importc: "IupControlsClose", dynlib: dllname.}

+  K_yA* = iUPyxCODE(K_upperA)

+  K_yB* = iUPyxCODE(K_upperB)

+  K_yC* = iUPyxCODE(K_upperC)

+  K_yD* = iUPyxCODE(K_upperD)

+  K_yE* = iUPyxCODE(K_upperE)

+  K_yF* = iUPyxCODE(K_upperF)

+  K_yG* = iUPyxCODE(K_upperG)

+  K_yH* = iUPyxCODE(K_upperH)

+  K_yI* = iUPyxCODE(K_upperI)

+  K_yJ* = iUPyxCODE(K_upperJ)

+  K_yK* = iUPyxCODE(K_upperK)

+  K_yL* = iUPyxCODE(K_upperL)

+  K_yM* = iUPyxCODE(K_upperM)

+  K_yN* = iUPyxCODE(K_upperN)

+  K_yO* = iUPyxCODE(K_upperO)

+  K_yP* = iUPyxCODE(K_upperP)

+  K_yQ* = iUPyxCODE(K_upperQ)

+  K_yR* = iUPyxCODE(K_upperR)

+  K_yS* = iUPyxCODE(K_upperS)

+  K_yT* = iUPyxCODE(K_upperT)

+  K_yU* = iUPyxCODE(K_upperU)

+  K_yV* = iUPyxCODE(K_upperV)

+  K_yW* = iUPyxCODE(K_upperW)

+  K_yX* = iUPyxCODE(K_upperX)

+  K_yY* = iUPyxCODE(K_upperY)

+  K_yZ* = iUPyxCODE(K_upperZ)

+  K_y1* = iUPyxCODE(K_1)

+  K_y2* = iUPyxCODE(K_2)

+  K_y3* = iUPyxCODE(K_3)

+  K_y4* = iUPyxCODE(K_4)

+  K_y5* = iUPyxCODE(K_5)

+  K_y6* = iUPyxCODE(K_6)

+  K_y7* = iUPyxCODE(K_7)        

+  K_y8* = iUPyxCODE(K_8)         

+  K_y9* = iUPyxCODE(K_9)

+  K_y0* = iUPyxCODE(K_0)

+  K_yPlus* = iUPyxCODE(K_plus)

+  K_yComma* = iUPyxCODE(K_comma)

+  K_yMinus* = iUPyxCODE(K_minus)   

+  K_yPeriod* = iUPyxCODE(K_period)   

+  K_ySlash* = iUPyxCODE(K_slash)   

+  K_ySemicolon* = iUPyxCODE(K_semicolon) 

+  K_yEqual* = iUPyxCODE(K_equal)

+  K_yBracketleft* = iUPyxCODE(K_bracketleft)

+  K_yBracketright* = iUPyxCODE(K_bracketright)

+  K_yBackslash* = iUPyxCODE(K_backslash)

+  K_yAsterisk* = iUPyxCODE(K_asterisk)

+
+proc controlsOpen*(): cint {.cdecl, importc: "IupControlsOpen", dynlib: dllname.}

+proc controlsClose*() {.cdecl, importc: "IupControlsClose", dynlib: dllname.}

 

-proc OldValOpen*() {.cdecl, importc: "IupOldValOpen", dynlib: dllname.}

-proc OldTabsOpen*() {.cdecl, importc: "IupOldTabsOpen", dynlib: dllname.}

+proc oldValOpen*() {.cdecl, importc: "IupOldValOpen", dynlib: dllname.}

+proc oldTabsOpen*() {.cdecl, importc: "IupOldTabsOpen", dynlib: dllname.}

 

-proc Colorbar*(): PIhandle {.cdecl, importc: "IupColorbar", dynlib: dllname.}

-proc Cells*(): PIhandle {.cdecl, importc: "IupCells", dynlib: dllname.}

-proc ColorBrowser*(): PIhandle {.cdecl, importc: "IupColorBrowser", dynlib: dllname.}

-proc Gauge*(): PIhandle {.cdecl, importc: "IupGauge", dynlib: dllname.}

-proc Dial*(theType: cstring): PIhandle {.cdecl, importc: "IupDial", dynlib: dllname.}

-proc Matrix*(action: cstring): PIhandle {.cdecl, importc: "IupMatrix", dynlib: dllname.}

+proc colorbar*(): PIhandle {.cdecl, importc: "IupColorbar", dynlib: dllname.}

+proc cells*(): PIhandle {.cdecl, importc: "IupCells", dynlib: dllname.}

+proc colorBrowser*(): PIhandle {.cdecl, importc: "IupColorBrowser", dynlib: dllname.}

+proc gauge*(): PIhandle {.cdecl, importc: "IupGauge", dynlib: dllname.}

+proc dial*(theType: cstring): PIhandle {.cdecl, importc: "IupDial", dynlib: dllname.}

+proc matrix*(action: cstring): PIhandle {.cdecl, importc: "IupMatrix", dynlib: dllname.}

 

 # IupMatrix utilities

-proc MatSetAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
+proc matSetAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
                       value: cstring) {.
                       cdecl, importc: "IupMatSetAttribute", dynlib: dllname.}

-proc MatStoreAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
+proc matStoreAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
                         value: cstring) {.cdecl, 
                         importc: "IupMatStoreAttribute", dynlib: dllname.}

-proc MatGetAttribute*(ih: PIhandle, name: cstring, lin, col: cint): cstring {.
+proc matGetAttribute*(ih: PIhandle, name: cstring, lin, col: cint): cstring {.
   cdecl, importc: "IupMatGetAttribute", dynlib: dllname.}

-proc MatGetInt*(ih: PIhandle, name: cstring, lin, col: cint): cint {.
+proc matGetInt*(ih: PIhandle, name: cstring, lin, col: cint): cint {.
   cdecl, importc: "IupMatGetInt", dynlib: dllname.}

-proc MatGetFloat*(ih: PIhandle, name: cstring, lin, col: cint): cfloat {.
+proc matGetFloat*(ih: PIhandle, name: cstring, lin, col: cint): cfloat {.
   cdecl, importc: "IupMatGetFloat", dynlib: dllname.}

-proc MatSetfAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
+proc matSetfAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
                        format: cstring) {.cdecl, 
                        importc: "IupMatSetfAttribute", 
                        dynlib: dllname, varargs.}

@@ -916,34 +916,34 @@ const
   IUP_SECONDARY* = -2

 

 # Initialize PPlot widget class

-proc PPlotOpen*() {.cdecl, importc: "IupPPlotOpen", dynlib: dllname.}

+proc pPlotOpen*() {.cdecl, importc: "IupPPlotOpen", dynlib: dllname.}

 

 # Create an PPlot widget instance

-proc PPlot*: PIhandle {.cdecl, importc: "IupPPlot", dynlib: dllname.}

+proc pPlot*: PIhandle {.cdecl, importc: "IupPPlot", dynlib: dllname.}

 

 # Add dataset to plot

-proc PPlotBegin*(ih: PIhandle, strXdata: cint) {.
+proc pPlotBegin*(ih: PIhandle, strXdata: cint) {.
   cdecl, importc: "IupPPlotBegin", dynlib: dllname.}

-proc PPlotAdd*(ih: PIhandle, x, y: cfloat) {.
+proc pPlotAdd*(ih: PIhandle, x, y: cfloat) {.
   cdecl, importc: "IupPPlotAdd", dynlib: dllname.}

-proc PPlotAddStr*(ih: PIhandle, x: cstring, y: cfloat) {.
+proc pPlotAddStr*(ih: PIhandle, x: cstring, y: cfloat) {.
   cdecl, importc: "IupPPlotAddStr", dynlib: dllname.}

-proc PPlotEnd*(ih: PIhandle): cint {.
+proc pPlotEnd*(ih: PIhandle): cint {.
   cdecl, importc: "IupPPlotEnd", dynlib: dllname.}

 

-proc PPlotInsertStr*(ih: PIhandle, index, sample_index: cint, x: cstring, 
+proc pPlotInsertStr*(ih: PIhandle, index, sample_index: cint, x: cstring, 
                      y: cfloat) {.cdecl, importc: "IupPPlotInsertStr", 
                      dynlib: dllname.}

-proc PPlotInsert*(ih: PIhandle, index, sample_index: cint, 
+proc pPlotInsert*(ih: PIhandle, index, sample_index: cint, 
                   x, y: cfloat) {.
                   cdecl, importc: "IupPPlotInsert", dynlib: dllname.}

 

 # convert from plot coordinates to pixels

-proc PPlotTransform*(ih: PIhandle, x, y: cfloat, ix, iy: var cint) {.
+proc pPlotTransform*(ih: PIhandle, x, y: cfloat, ix, iy: var cint) {.
   cdecl, importc: "IupPPlotTransform", dynlib: dllname.}

 

 # Plot on the given device. Uses a "cdCanvas*".

-proc PPlotPaintTo*(ih: PIhandle, cnv: pointer) {.
+proc pPlotPaintTo*(ih: PIhandle, cnv: pointer) {.
   cdecl, importc: "IupPPlotPaintTo", dynlib: dllname.}

 

 
diff --git a/lib/wrappers/sdl/sdl.nim b/lib/wrappers/sdl/sdl.nim
index 1c88bc14e..753796274 100644
--- a/lib/wrappers/sdl/sdl.nim
+++ b/lib/wrappers/sdl/sdl.nim
@@ -250,14 +250,14 @@
 #      SDL_GL_MULTISAMPLESAMPLES
 #
 #  Add DLL/Shared object functions
-#  function SDL_LoadObject( const sofile : PChar ) : Pointer;
+#  function SDL_LoadObject( const sofile : PChar ) : pointer;
 #
-#  function SDL_LoadFunction( handle : Pointer; const name : PChar ) : Pointer;
+#  function SDL_LoadFunction( handle : pointer; const name : PChar ) : pointer;
 #
-#  procedure SDL_UnloadObject( handle : Pointer );
+#  procedure SDL_UnloadObject( handle : pointer );
 #
 #  Added function to create RWops from const memory: SDL_RWFromConstMem()
-#  function SDL_RWFromConstMem(const mem: Pointer; size: Integer) : PSDL_RWops;
+#  function SDL_RWFromConstMem(const mem: pointer; size: Integer) : PSDL_RWops;
 #
 #  Ported SDL_cpuinfo.h so Now you can test for Specific CPU types.
 #
@@ -756,9 +756,9 @@ type
     sdlFALSE, sdlTRUE
   PUInt8Array* = ptr TUInt8Array
   TUInt8Array* = array[0..high(int) shr 1, byte]
-  PUInt16* = ptr UInt16
-  PUInt32* = ptr UInt32
-  PUInt64* = ptr UInt64
+  PUInt16* = ptr uInt16
+  PUInt32* = ptr uInt32
+  PUInt64* = ptr uInt64
   UInt64*{.final.} = object 
     hi*: int32
     lo*: int32
@@ -790,8 +790,8 @@ type
     args*: array[0..ERR_MAX_ARGS - 1, TArg]
 
   TStdio*{.final.} = object 
-    autoclose*: int           # FILE * is only defined in Kylix so we use a simple Pointer
-    fp*: Pointer
+    autoclose*: int           # FILE * is only defined in Kylix so we use a simple pointer
+    fp*: pointer
 
   TMem*{.final.} = object 
     base*: ptr byte
@@ -800,9 +800,9 @@ type
 
   PRWops* = ptr TRWops        # now the pointer to function types
   TSeek* = proc (context: PRWops, offset: int, whence: int): int{.cdecl.}
-  TRead* = proc (context: PRWops, thePtr: Pointer, size: int, maxnum: int): int{.
+  TRead* = proc (context: PRWops, thePtr: pointer, size: int, maxnum: int): int{.
       cdecl.}
-  TWrite* = proc (context: PRWops, thePtr: Pointer, size: int, num: int): int{.
+  TWrite* = proc (context: PRWops, thePtr: pointer, size: int, num: int): int{.
       cdecl.}
   TClose* = proc (context: PRWops): int{.cdecl.} # the variant record itself
   TRWops*{.final.} = object 
@@ -817,27 +817,27 @@ type
   RWops* = TRWops             # SDL_timer.h types
                               # Function prototype for the timer callback function
   TTimerCallback* = proc (interval: int32): int32{.cdecl.}
-  TNewTimerCallback* = proc (interval: int32, param: Pointer): int32{.cdecl.}
+  TNewTimerCallback* = proc (interval: int32, param: pointer): int32{.cdecl.}
 
   PTimerID* = ptr TTimerID
   TTimerID*{.final.} = object 
     interval*: int32
     callback*: TNewTimerCallback
-    param*: Pointer
+    param*: pointer
     last_alarm*: int32
     next*: PTimerID
 
-  TAudioSpecCallback* = proc (userdata: Pointer, stream: ptr byte, length: int){.
+  TAudioSpecCallback* = proc (userdata: pointer, stream: ptr byte, length: int){.
       cdecl.}                 # SDL_audio.h types
                               # The calculated values in this structure are calculated by SDL_OpenAudio()
   PAudioSpec* = ptr TAudioSpec
   TAudioSpec*{.final.} = object  # A structure to hold a set of audio conversion filters and buffers
     freq*: int                # DSP frequency -- samples per second
-    format*: UInt16           # Audio data format
+    format*: uInt16           # Audio data format
     channels*: byte          # Number of channels: 1 mono, 2 stereo
     silence*: byte           # Audio buffer silence value (calculated)
-    samples*: UInt16          # Audio buffer size in samples
-    padding*: UInt16          # Necessary for some compile environments
+    samples*: uInt16          # Audio buffer size in samples
+    padding*: uInt16          # Necessary for some compile environments
     size*: int32 # Audio buffer size in bytes (calculated)
                  # This function is called when the audio device needs more data.
                  # 'stream' is a pointer to the audio data buffer
@@ -845,20 +845,20 @@ type
                  # Once the callback returns, the buffer will no longer be valid.
                  # Stereo samples are stored in a LRLRLR ordering.
     callback*: TAudioSpecCallback
-    userdata*: Pointer
+    userdata*: pointer
 
   PAudioCVT* = ptr TAudioCVT
   PAudioCVTFilter* = ptr TAudioCVTFilter
   TAudioCVTFilter*{.final.} = object 
     cvt*: PAudioCVT
-    format*: UInt16
+    format*: uint16
 
   PAudioCVTFilterArray* = ptr TAudioCVTFilterArray
   TAudioCVTFilterArray* = array[0..9, PAudioCVTFilter]
   TAudioCVT*{.final.} = object 
     needed*: int              # Set to 1 if conversion possible
-    src_format*: UInt16       # Source audio format
-    dst_format*: UInt16       # Target audio format
+    src_format*: uint16       # Source audio format
+    dst_format*: uint16       # Target audio format
     rate_incr*: float64       # Rate conversion increment
     buf*: ptr byte              # Buffer to hold entire audio data
     length*: int              # Length of original audio buffer
@@ -876,7 +876,7 @@ type
   TCDTrack*{.final.} = object  # This structure is only current as of the last call to SDL_CDStatus()
     id*: byte                # Track number
     theType*: byte           # Data or audio track
-    unused*: UInt16
+    unused*: uint16
     len*: int32              # Length, in frames, of this track
     offset*: int32           # Offset, in frames, from start of disk
   
@@ -945,7 +945,7 @@ type
     scancode*: byte           # hardware specific scancode
     sym*: TKey                # SDL virtual keysym
     modifier*: TMod           # current key modifiers
-    unicode*: UInt16          # translated character
+    unicode*: uint16          # translated character
   
   TEventAction* = enum        # Application visibility event structure
     ADDEVENT, PEEKEVENT, GETEVENT
@@ -971,7 +971,7 @@ type
     kind*: TEventKind
     which*: byte             # The mouse device index
     state*: byte             # The current button state
-    x*, y*: UInt16            # The X/Y coordinates of the mouse
+    x*, y*: uint16            # The X/Y coordinates of the mouse
     xrel*: int16             # The relative motion in the X direction
     yrel*: int16             # The relative motion in the Y direction
   
@@ -982,8 +982,8 @@ type
     which*: byte             # The mouse device index
     button*: byte            # The mouse button index
     state*: byte             # SDL_PRESSED or SDL_RELEASED
-    x*: UInt16                # The X coordinates of the mouse at press time
-    y*: UInt16                # The Y coordinates of the mouse at press time
+    x*: uint16                # The X coordinates of the mouse at press time
+    y*: uint16                # The Y coordinates of the mouse at press time
   
   PJoyAxisEvent* = ptr TJoyAxisEvent
   TJoyAxisEvent*{.final.} = object  # SDL_JOYAXISMOTION
@@ -1036,8 +1036,8 @@ type
   TUserEvent*{.final.} = object  # SDL_USEREVENT through SDL_NUMEVENTS-1
     kind*: TEventKind
     code*: cint                # User defined event code
-    data1*: Pointer           # User defined data pointer
-    data2*: Pointer           # User defined data pointer 
+    data1*: pointer           # User defined data pointer
+    data2*: pointer           # User defined data pointer 
   
 
 when defined(Unix): 
@@ -1090,8 +1090,8 @@ elif defined(Unix):
                               # any X11 functions using the display variable.
                               # They lock the event thread, so should not be
                               # called around event functions or from event filters.
-          lock_func*: Pointer
-          unlock_func*: Pointer # Introduced in SDL 1.0.2
+          lock_func*: pointer
+          unlock_func*: pointer # Introduced in SDL 1.0.2
           fswindow*: TWindow  # The X11 fullscreen window
           wmwindow*: TWindow  # The X11 managed input window
         
@@ -1135,7 +1135,7 @@ type
   PRect* = ptr TRect
   TRect*{.final.} = object 
     x*, y*: int16
-    w*, h*: UInt16
+    w*, h*: uint16
 
   Rect* = TRect
   PColor* = ptr TColor
@@ -1182,7 +1182,7 @@ type
     d_width*: int
     d_height*: int
     d_skip*: int
-    aux_data*: Pointer
+    aux_data*: pointer
     src*: PPixelFormat
     table*: ptr byte
     dst*: PPixelFormat
@@ -1194,17 +1194,17 @@ type
     flags*: int32            # Read-only
     format*: PPixelFormat     # Read-only
     w*, h*: cint              # Read-only
-    pitch*: UInt16            # Read-only
-    pixels*: Pointer          # Read-write
+    pitch*: uint16            # Read-only
+    pixels*: pointer          # Read-write
     offset*: cint             # Private
-    hwdata*: Pointer          #TPrivate_hwdata;  Hardware-specific surface info
+    hwdata*: pointer          #TPrivate_hwdata;  Hardware-specific surface info
                               # clipping information:
     clip_rect*: TRect         # Read-only
     unused1*: int32           # for binary compatibility
                               # Allow recursive locks
     locked*: int32            # Private
                               # info for fast blit mapping to other surfaces
-    Blitmap*: Pointer         # PSDL_BlitMap; //   Private
+    Blitmap*: pointer         # PSDL_BlitMap; //   Private
                               # format version, bumped at every change to invalidate blit maps
     format_version*: cint      # Private
     refcount*: cint
@@ -1241,7 +1241,7 @@ type
     data*: ptr byte             # B/W cursor data
     mask*: ptr byte             # B/W cursor mask
     save*: array[1..2, ptr byte] # Place to save cursor area
-    wm_cursor*: Pointer       # Window-manager cursor
+    wm_cursor*: pointer       # Window-manager cursor
   
 
 type 
@@ -1268,7 +1268,7 @@ type                          # This is the system-independent thread info struc
     handle*: TSYS_ThreadHandle
     status*: int
     errbuf*: TError
-    data*: Pointer
+    data*: pointer
 
   PKeyStateArr* = ptr TKeyStateArr
   TKeyStateArr* = array[0..65000, byte] # Types required so we don't need to use Windows.pas
@@ -1326,7 +1326,7 @@ proc WasInit*(flags: int32): int32{.cdecl, importc: "SDL_WasInit",
 proc Quit*(){.cdecl, importc: "SDL_Quit", dynlib: LibName.}
 when defined(WINDOWS): 
   # This should be called from your WinMain() function, if any
-  proc RegisterApp*(name: cstring, style: int32, h_Inst: Pointer): int{.cdecl, 
+  proc RegisterApp*(name: cstring, style: int32, h_Inst: pointer): int{.cdecl, 
       importc: "SDL_RegisterApp", dynlib: LibName.}
 proc TableSize*(table: cstring): int
   #------------------------------------------------------------------------------
@@ -1347,17 +1347,17 @@ proc RWFromFile*(filename, mode: cstring): PRWops{.cdecl,
     importc: "SDL_RWFromFile", dynlib: LibName.}
 proc FreeRW*(area: PRWops){.cdecl, importc: "SDL_FreeRW", dynlib: LibName.}
   #fp is FILE *fp ???
-proc RWFromFP*(fp: Pointer, autoclose: int): PRWops{.cdecl, 
+proc RWFromFP*(fp: pointer, autoclose: int): PRWops{.cdecl, 
     importc: "SDL_RWFromFP", dynlib: LibName.}
-proc RWFromMem*(mem: Pointer, size: int): PRWops{.cdecl, 
+proc RWFromMem*(mem: pointer, size: int): PRWops{.cdecl, 
     importc: "SDL_RWFromMem", dynlib: LibName.}
-proc RWFromConstMem*(mem: Pointer, size: int): PRWops{.cdecl, 
+proc RWFromConstMem*(mem: pointer, size: int): PRWops{.cdecl, 
     importc: "SDL_RWFromConstMem", dynlib: LibName.}
 proc AllocRW*(): PRWops{.cdecl, importc: "SDL_AllocRW", dynlib: LibName.}
 proc RWSeek*(context: PRWops, offset: int, whence: int): int
 proc RWTell*(context: PRWops): int
-proc RWRead*(context: PRWops, theptr: Pointer, size: int, n: int): int
-proc RWWrite*(context: PRWops, theptr: Pointer, size: int, n: int): int
+proc RWRead*(context: PRWops, theptr: pointer, size: int, n: int): int
+proc RWWrite*(context: PRWops, theptr: pointer, size: int, n: int): int
 proc RWClose*(context: PRWops): int
   #------------------------------------------------------------------------------
   # time-handling
@@ -1369,7 +1369,7 @@ proc GetTicks*(): int32{.cdecl, importc: "SDL_GetTicks", dynlib: LibName.}
 proc Delay*(msec: int32){.cdecl, importc: "SDL_Delay", dynlib: LibName.}
   # Add a new timer to the pool of timers already running.
   # Returns a timer ID, or NULL when an error occurs.
-proc AddTimer*(interval: int32, callback: TNewTimerCallback, param: Pointer): PTimerID{.
+proc AddTimer*(interval: int32, callback: TNewTimerCallback, param: pointer): PTimerID{.
     cdecl, importc: "SDL_AddTimer", dynlib: LibName.}
   # Remove one of the multiple timers knowing its ID.
   # Returns a boolean value indicating success.
@@ -1387,7 +1387,7 @@ proc AudioInit*(driver_name: cstring): int{.cdecl, importc: "SDL_AudioInit",
     dynlib: LibName.}
 proc AudioQuit*(){.cdecl, importc: "SDL_AudioQuit", dynlib: LibName.}
   # This function fills the given character buffer with the name of the
-  #  current audio driver, and returns a Pointer to it if the audio driver has
+  #  current audio driver, and returns a pointer to it if the audio driver has
   #  been initialized.  It returns NULL if no driver has been initialized.
 proc AudioDriverName*(namebuf: cstring, maxlen: int): cstring{.cdecl, 
     importc: "SDL_AudioDriverName", dynlib: LibName.}
@@ -1470,8 +1470,8 @@ proc FreeWAV*(audio_buf: ptr byte){.cdecl, importc: "SDL_FreeWAV", dynlib: LibNa
   #  by SDL_ConvertAudio() to convert a buffer of audio data from one format
   #  to the other.
   #  This function returns 0, or -1 if there was an error.
-proc BuildAudioCVT*(cvt: PAudioCVT, src_format: UInt16, src_channels: byte, 
-                    src_rate: int, dst_format: UInt16, dst_channels: byte, 
+proc BuildAudioCVT*(cvt: PAudioCVT, src_format: uint16, src_channels: byte, 
+                    src_rate: int, dst_format: uint16, dst_channels: byte, 
                     dst_rate: int): int{.cdecl, importc: "SDL_BuildAudioCVT", 
     dynlib: LibName.}
   # Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
@@ -1937,12 +1937,12 @@ proc AllocSurface*(flags: int32, width, height, depth: int,
 proc CreateRGBSurface*(flags: int32, width, height, depth: int, 
                        RMask, GMask, BMask, AMask: int32): PSurface{.cdecl, 
     importc: "SDL_CreateRGBSurface", dynlib: LibName.}
-proc CreateRGBSurfaceFrom*(pixels: Pointer, width, height, depth, pitch: int, 
+proc CreateRGBSurfaceFrom*(pixels: pointer, width, height, depth, pitch: int, 
                            RMask, GMask, BMask, AMask: int32): PSurface{.cdecl, 
     importc: "SDL_CreateRGBSurfaceFrom", dynlib: LibName.}
 proc FreeSurface*(surface: PSurface){.cdecl, importc: "SDL_FreeSurface", 
                                       dynlib: LibName.}
-proc MustLock*(Surface: PSurface): bool
+proc MustLock*(surface: PSurface): bool
   # SDL_LockSurface() sets up a surface for directly accessing the pixels.
   #  Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
   #  to and read from 'surface->pixels', using the pixel format stored in
@@ -2178,7 +2178,7 @@ proc FreeYUVOverlay*(Overlay: POverlay){.cdecl, importc: "SDL_FreeYUVOverlay",
 proc GL_LoadLibrary*(filename: cstring): int{.cdecl, 
     importc: "SDL_GL_LoadLibrary", dynlib: LibName.}
   # Get the address of a GL function (for extension functions)
-proc GL_GetProcAddress*(procname: cstring): Pointer{.cdecl, 
+proc GL_GetProcAddress*(procname: cstring): pointer{.cdecl, 
     importc: "SDL_GL_GetProcAddress", dynlib: LibName.}
   # Set an attribute of the OpenGL subsystem before intialization.
 proc GL_SetAttribute*(attr: TGLAttr, value: int): int{.cdecl, 
@@ -2255,7 +2255,7 @@ proc GetMouseState*(x: var int, y: var int): byte{.cdecl,
 proc GetRelativeMouseState*(x: var int, y: var int): byte{.cdecl, 
     importc: "SDL_GetRelativeMouseState", dynlib: LibName.}
   # Set the position of the mouse cursor (generates a mouse motion event)
-proc WarpMouse*(x, y: UInt16){.cdecl, importc: "SDL_WarpMouse", dynlib: LibName.}
+proc WarpMouse*(x, y: uint16){.cdecl, importc: "SDL_WarpMouse", dynlib: LibName.}
   # Create a cursor using the specified data and mask (in MSB format).
   #  The cursor width must be a multiple of 8 bits.
   #
@@ -2402,7 +2402,7 @@ proc CondWaitTimeout*(cond: Pcond, mut: Pmutex, ms: int32): int{.cdecl,
   # Condition variable functions
   # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
   # Create a thread
-proc CreateThread*(fn, data: Pointer): PThread{.cdecl, 
+proc CreateThread*(fn, data: pointer): PThread{.cdecl, 
     importc: "SDL_CreateThread", dynlib: LibName.}
   # Get the 32-bit thread identifier for the current thread
 proc ThreadID*(): int32{.cdecl, importc: "SDL_ThreadID", dynlib: LibName.}
@@ -2435,16 +2435,16 @@ proc GetWMInfo*(info: PSysWMinfo): int{.cdecl, importc: "SDL_GetWMInfo",
   # * to the object handle (or NULL if there was an error).
   # * The 'sofile' parameter is a system dependent name of the object file.
   # *
-proc LoadObject*(sofile: cstring): Pointer{.cdecl, importc: "SDL_LoadObject", 
+proc LoadObject*(sofile: cstring): pointer{.cdecl, importc: "SDL_LoadObject", 
     dynlib: LibName.}
   #* Given an object handle, this function looks up the address of the
   # * named function in the shared object and returns it.  This address
   # * is no longer valid after calling SDL_UnloadObject().
   # *
-proc LoadFunction*(handle: Pointer, name: cstring): Pointer{.cdecl, 
+proc LoadFunction*(handle: pointer, name: cstring): pointer{.cdecl, 
     importc: "SDL_LoadFunction", dynlib: LibName.}
   #* Unload a shared object from memory *
-proc UnloadObject*(handle: Pointer){.cdecl, importc: "SDL_UnloadObject", 
+proc UnloadObject*(handle: pointer){.cdecl, importc: "SDL_UnloadObject", 
                                      dynlib: LibName.}
   #------------------------------------------------------------------------------
 proc Swap32*(D: int32): int32
@@ -2455,32 +2455,32 @@ proc TurnBitOff*(value: int, bit: int8): int
 # implementation
 
 proc TABLESIZE(table: cstring): int = 
-  Result = SizeOf(table) div SizeOf(table[0])
+  result = sizeOf(table) div sizeOf(table[0])
 
 proc OutOfMemory() = 
   when not (defined(WINDOWS)): Error(ENOMEM)
   
 proc RWSeek(context: PRWops, offset: int, whence: int): int = 
-  Result = context.seek(context, offset, whence)
+  result = context.seek(context, offset, whence)
 
 proc RWTell(context: PRWops): int = 
-  Result = context.seek(context, 0, 1)
+  result = context.seek(context, 0, 1)
 
-proc RWRead(context: PRWops, theptr: Pointer, size: int, n: int): int = 
-  Result = context.read(context, theptr, size, n)
+proc RWRead(context: PRWops, theptr: pointer, size: int, n: int): int = 
+  result = context.read(context, theptr, size, n)
 
-proc RWWrite(context: PRWops, theptr: Pointer, size: int, n: int): int = 
-  Result = context.write(context, theptr, size, n)
+proc RWWrite(context: PRWops, theptr: pointer, size: int, n: int): int = 
+  result = context.write(context, theptr, size, n)
 
 proc RWClose(context: PRWops): int = 
-  Result = context.closeFile(context)
+  result = context.closeFile(context)
 
 proc LoadWAV(filename: cstring, spec: PAudioSpec, audio_buf: ptr byte, 
              audiolen: PUInt32): PAudioSpec = 
-  Result = LoadWAV_RW(RWFromFile(filename, "rb"), 1, spec, audio_buf, audiolen)
+  result = LoadWAV_RW(RWFromFile(filename, "rb"), 1, spec, audio_buf, audiolen)
 
 proc CDInDrive(status: TCDStatus): bool = 
-  Result = ord(status) > ord(CD_ERROR)
+  result = ord(status) > ord(CD_ERROR)
 
 proc FRAMES_TO_MSF(frames: int, M: var int, S: var int, F: var int) = 
   var value: int
@@ -2492,7 +2492,7 @@ proc FRAMES_TO_MSF(frames: int, M: var int, S: var int, F: var int) =
   M = value
 
 proc MSF_TO_FRAMES(M: int, S: int, F: int): int = 
-  Result = M * 60 * CD_FPS + S * CD_FPS + F
+  result = M * 60 * CD_FPS + S * CD_FPS + F
 
 proc VERSION(X: var TVersion) = 
   X.major = MAJOR_VERSION
@@ -2500,43 +2500,43 @@ proc VERSION(X: var TVersion) =
   X.patch = PATCHLEVEL
 
 proc VERSIONNUM(X, Y, Z: int): int = 
-  Result = X * 1000 + Y * 100 + Z
+  result = X * 1000 + Y * 100 + Z
 
 proc COMPILEDVERSION(): int = 
-  Result = VERSIONNUM(MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL)
+  result = VERSIONNUM(MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL)
 
 proc VERSION_ATLEAST(X, Y, Z: int): bool = 
-  Result = (COMPILEDVERSION() >= VERSIONNUM(X, Y, Z))
+  result = (COMPILEDVERSION() >= VERSIONNUM(X, Y, Z))
 
 proc LoadBMP(filename: cstring): PSurface = 
-  Result = LoadBMP_RW(RWFromFile(filename, "rb"), 1)
+  result = LoadBMP_RW(RWFromFile(filename, "rb"), 1)
 
 proc SaveBMP(surface: PSurface, filename: cstring): int = 
-  Result = SaveBMP_RW(surface, RWFromFile(filename, "wb"), 1)
+  result = SaveBMP_RW(surface, RWFromFile(filename, "wb"), 1)
 
 proc BlitSurface(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int = 
-  Result = UpperBlit(src, srcrect, dst, dstrect)
+  result = UpperBlit(src, srcrect, dst, dstrect)
 
 proc AllocSurface(flags: int32, width, height, depth: int, 
                   RMask, GMask, BMask, AMask: int32): PSurface = 
-  Result = CreateRGBSurface(flags, width, height, depth, RMask, GMask, BMask, 
+  result = CreateRGBSurface(flags, width, height, depth, RMask, GMask, BMask, 
                             AMask)
 
-proc MustLock(Surface: PSurface): bool = 
-  Result = ((surface[].offset != 0) or
-      ((surface[].flags and (HWSURFACE or ASYNCBLIT or RLEACCEL)) != 0))
+proc MustLock(surface: PSurface): bool = 
+  result = ((surface.offset != 0) or
+      ((surface.flags and (HWSURFACE or ASYNCBLIT or RLEACCEL)) != 0))
 
 proc LockMutex(mutex: Pmutex): int = 
-  Result = mutexP(mutex)
+  result = mutexP(mutex)
 
 proc UnlockMutex(mutex: Pmutex): int = 
-  Result = mutexV(mutex)
+  result = mutexV(mutex)
 
 proc BUTTON(Button: int): int = 
-  Result = PRESSED shl (Button - 1)
+  result = PRESSED shl (Button - 1)
 
 proc Swap32(D: int32): int32 = 
-  Result = ((D shl 24) or ((D shl 8) and 0x00FF0000) or
+  result = ((D shl 24) or ((D shl 8) and 0x00FF0000) or
       ((D shr 8) and 0x0000FF00) or (D shr 24))
 
 proc IsBitOn(value: int, bit: int8): bool =