summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-desktop>2010-01-08 00:29:58 +0100
committerAndreas Rumpf <andreas@andreas-desktop>2010-01-08 00:29:58 +0100
commit868f8f8af7b2813a2ff95d5bf58ae918d3e4bfa3 (patch)
tree4ceb2cd89e5763a6662ce3297c852c2dcd5965f7 /lib
parenta8303679960a13aa9ddd1f2fa44c2e4f9a12f071 (diff)
downloadNim-868f8f8af7b2813a2ff95d5bf58ae918d3e4bfa3.tar.gz
further development of new wrappers
Diffstat (limited to 'lib')
-rwxr-xr-xlib/newwrap/cairo/cairo.nim208
-rwxr-xr-xlib/newwrap/cairo/cairoft.nim4
-rwxr-xr-xlib/newwrap/cairo/cairowin32.nim2
-rwxr-xr-xlib/newwrap/cairo/cairoxlib.nim2
-rwxr-xr-xlib/newwrap/gtk/atk.nim4
-rwxr-xr-xlib/newwrap/gtk/gdk2.nim149
-rwxr-xr-xlib/newwrap/gtk/gtk2.nim1245
-rwxr-xr-xlib/newwrap/libcurl.nim49
-rwxr-xr-xlib/newwrap/lua/lauxlib.nim182
-rwxr-xr-xlib/newwrap/lua/lua.nim48
-rwxr-xr-xlib/newwrap/lua/lualib.nim24
-rwxr-xr-xlib/newwrap/sdl/sdl.nim2
-rwxr-xr-xlib/newwrap/sdl/sdl_gfx.nim2
-rwxr-xr-xlib/newwrap/sdl/sdl_image.nim12
-rwxr-xr-xlib/newwrap/sdl/sdl_mixer.nim506
-rwxr-xr-xlib/newwrap/sdl/sdl_mixer_nosmpeg.nim471
-rwxr-xr-xlib/newwrap/sdl/sdl_net.nim151
-rwxr-xr-xlib/newwrap/sdl/sdl_ttf.nim128
-rwxr-xr-xlib/newwrap/sdl/smpeg.nim148
19 files changed, 1378 insertions, 1959 deletions
diff --git a/lib/newwrap/cairo/cairo.nim b/lib/newwrap/cairo/cairo.nim
index d391b4622..f23162288 100755
--- a/lib/newwrap/cairo/cairo.nim
+++ b/lib/newwrap/cairo/cairo.nim
@@ -115,7 +115,7 @@ type
     SVG_VERSION_1_1, SVG_VERSION_1_2
   PSurface* = ptr TSurface
   PPCairoSurface* = ptr PSurface
-  P* = ptr T
+  PCairo* = ptr TCario
   PPattern* = ptr TPattern
   PFontOptions* = ptr TFontOptions
   PFontFace* = ptr TFontFace
@@ -135,7 +135,7 @@ type
   TDestroyFunc* = proc (data: Pointer){.cdecl.}
   TWriteFunc* = proc (closure: Pointer, data: PByte, len: int32): TStatus{.cdecl.}
   TReadFunc* = proc (closure: Pointer, data: PByte, len: int32): TStatus{.cdecl.}
-  T*{.final.} = object        #OPAQUE
+  TCario*{.final.} = object        #OPAQUE
   TSurface*{.final.} = object  #OPAQUE
   TPattern*{.final.} = object  #OPAQUE
   TScaledFont*{.final.} = object  #OPAQUE
@@ -198,130 +198,130 @@ proc version_string*(): cstring{.cdecl, importc: "cairo_version_string",
   #Helper function to retrieve decoded version
 proc version*(major, minor, micro: var int32)
   #* Functions for manipulating state objects
-proc create*(target: PSurface): P{.cdecl, importc: "cairo_create", 
+proc create*(target: PSurface): PCairo{.cdecl, importc: "cairo_create", 
                                    dynlib: LIB_CAIRO.}
-proc reference*(cr: P): P{.cdecl, importc: "cairo_reference", dynlib: LIB_CAIRO.}
-proc destroy*(cr: P){.cdecl, importc: "cairo_destroy", dynlib: LIB_CAIRO.}
-proc get_reference_count*(cr: P): int32{.cdecl, 
+proc reference*(cr: PCairo): PCairo{.cdecl, importc: "cairo_reference", dynlib: LIB_CAIRO.}
+proc destroy*(cr: PCairo){.cdecl, importc: "cairo_destroy", dynlib: LIB_CAIRO.}
+proc get_reference_count*(cr: PCairo): int32{.cdecl, 
     importc: "cairo_get_reference_count", dynlib: LIB_CAIRO.}
-proc get_user_data*(cr: P, key: PUserDataKey): pointer{.cdecl, 
+proc get_user_data*(cr: PCairo, key: PUserDataKey): pointer{.cdecl, 
     importc: "cairo_get_user_data", dynlib: LIB_CAIRO.}
-proc set_user_data*(cr: P, key: PUserDataKey, user_data: Pointer, 
+proc set_user_data*(cr: PCairo, key: PUserDataKey, user_data: Pointer, 
                     destroy: TDestroyFunc): TStatus{.cdecl, 
     importc: "cairo_set_user_data", dynlib: LIB_CAIRO.}
-proc save*(cr: P){.cdecl, importc: "cairo_save", dynlib: LIB_CAIRO.}
-proc restore*(cr: P){.cdecl, importc: "cairo_restore", dynlib: LIB_CAIRO.}
-proc push_group*(cr: P){.cdecl, importc: "cairo_push_group", dynlib: LIB_CAIRO.}
-proc push_group_with_content*(cr: P, content: TContent){.cdecl, 
+proc save*(cr: PCairo){.cdecl, importc: "cairo_save", dynlib: LIB_CAIRO.}
+proc restore*(cr: PCairo){.cdecl, importc: "cairo_restore", dynlib: LIB_CAIRO.}
+proc push_group*(cr: PCairo){.cdecl, importc: "cairo_push_group", dynlib: LIB_CAIRO.}
+proc push_group_with_content*(cr: PCairo, content: TContent){.cdecl, 
     importc: "cairo_push_group_with_content", dynlib: LIB_CAIRO.}
-proc pop_group*(cr: P): PPattern{.cdecl, importc: "cairo_pop_group", 
+proc pop_group*(cr: PCairo): PPattern{.cdecl, importc: "cairo_pop_group", 
                                   dynlib: LIB_CAIRO.}
-proc pop_group_to_source*(cr: P){.cdecl, importc: "cairo_pop_group_to_source", 
+proc pop_group_to_source*(cr: PCairo){.cdecl, importc: "cairo_pop_group_to_source", 
                                   dynlib: LIB_CAIRO.}
   #* Modify state
-proc set_operator*(cr: P, op: TOperator){.cdecl, importc: "cairo_set_operator", 
+proc set_operator*(cr: PCairo, op: TOperator){.cdecl, importc: "cairo_set_operator", 
     dynlib: LIB_CAIRO.}
-proc set_source*(cr: P, source: PPattern){.cdecl, importc: "cairo_set_source", 
+proc set_source*(cr: PCairo, source: PPattern){.cdecl, importc: "cairo_set_source", 
     dynlib: LIB_CAIRO.}
-proc set_source_rgb*(cr: P, red, green, blue: float64){.cdecl, 
+proc set_source_rgb*(cr: PCairo, red, green, blue: float64){.cdecl, 
     importc: "cairo_set_source_rgb", dynlib: LIB_CAIRO.}
-proc set_source_rgba*(cr: P, red, green, blue, alpha: float64){.cdecl, 
+proc set_source_rgba*(cr: PCairo, red, green, blue, alpha: float64){.cdecl, 
     importc: "cairo_set_source_rgba", dynlib: LIB_CAIRO.}
-proc set_source_surface*(cr: P, surface: PSurface, x, y: float64){.cdecl, 
+proc set_source_surface*(cr: PCairo, surface: PSurface, x, y: float64){.cdecl, 
     importc: "cairo_set_source_surface", dynlib: LIB_CAIRO.}
-proc set_tolerance*(cr: P, tolerance: float64){.cdecl, 
+proc set_tolerance*(cr: PCairo, tolerance: float64){.cdecl, 
     importc: "cairo_set_tolerance", dynlib: LIB_CAIRO.}
-proc set_antialias*(cr: P, antialias: TAntialias){.cdecl, 
+proc set_antialias*(cr: PCairo, antialias: TAntialias){.cdecl, 
     importc: "cairo_set_antialias", dynlib: LIB_CAIRO.}
-proc set_fill_rule*(cr: P, fill_rule: TFillRule){.cdecl, 
+proc set_fill_rule*(cr: PCairo, fill_rule: TFillRule){.cdecl, 
     importc: "cairo_set_fill_rule", dynlib: LIB_CAIRO.}
-proc set_line_width*(cr: P, width: float64){.cdecl, 
+proc set_line_width*(cr: PCairo, width: float64){.cdecl, 
     importc: "cairo_set_line_width", dynlib: LIB_CAIRO.}
-proc set_line_cap*(cr: P, line_cap: TLineCap){.cdecl, 
+proc set_line_cap*(cr: PCairo, line_cap: TLineCap){.cdecl, 
     importc: "cairo_set_line_cap", dynlib: LIB_CAIRO.}
-proc set_line_join*(cr: P, line_join: TLineJoin){.cdecl, 
+proc set_line_join*(cr: PCairo, line_join: TLineJoin){.cdecl, 
     importc: "cairo_set_line_join", dynlib: LIB_CAIRO.}
-proc set_dash*(cr: P, dashes: openarray[float64], offset: float64){.cdecl, 
+proc set_dash*(cr: PCairo, dashes: openarray[float64], offset: float64){.cdecl, 
     importc: "cairo_set_dash", dynlib: LIB_CAIRO.}
-proc set_miter_limit*(cr: P, limit: float64){.cdecl, 
+proc set_miter_limit*(cr: PCairo, limit: float64){.cdecl, 
     importc: "cairo_set_miter_limit", dynlib: LIB_CAIRO.}
-proc translate*(cr: P, tx, ty: float64){.cdecl, importc: "cairo_translate", 
+proc translate*(cr: PCairo, tx, ty: float64){.cdecl, importc: "cairo_translate", 
     dynlib: LIB_CAIRO.}
-proc scale*(cr: P, sx, sy: float64){.cdecl, importc: "cairo_scale", 
+proc scale*(cr: PCairo, sx, sy: float64){.cdecl, importc: "cairo_scale", 
                                      dynlib: LIB_CAIRO.}
-proc rotate*(cr: P, angle: float64){.cdecl, importc: "cairo_rotate", 
+proc rotate*(cr: PCairo, angle: float64){.cdecl, importc: "cairo_rotate", 
                                      dynlib: LIB_CAIRO.}
-proc transform*(cr: P, matrix: PMatrix){.cdecl, importc: "cairo_transform", 
+proc transform*(cr: PCairo, matrix: PMatrix){.cdecl, importc: "cairo_transform", 
     dynlib: LIB_CAIRO.}
-proc set_matrix*(cr: P, matrix: PMatrix){.cdecl, importc: "cairo_set_matrix", 
+proc set_matrix*(cr: PCairo, matrix: PMatrix){.cdecl, importc: "cairo_set_matrix", 
     dynlib: LIB_CAIRO.}
-proc identity_matrix*(cr: P){.cdecl, importc: "cairo_identity_matrix", 
+proc identity_matrix*(cr: PCairo){.cdecl, importc: "cairo_identity_matrix", 
                               dynlib: LIB_CAIRO.}
-proc user_to_device*(cr: P, x, y: var float64){.cdecl, 
+proc user_to_device*(cr: PCairo, x, y: var float64){.cdecl, 
     importc: "cairo_user_to_device", dynlib: LIB_CAIRO.}
-proc user_to_device_distance*(cr: P, dx, dy: var float64){.cdecl, 
+proc user_to_device_distance*(cr: PCairo, dx, dy: var float64){.cdecl, 
     importc: "cairo_user_to_device_distance", dynlib: LIB_CAIRO.}
-proc device_to_user*(cr: P, x, y: var float64){.cdecl, 
+proc device_to_user*(cr: PCairo, x, y: var float64){.cdecl, 
     importc: "cairo_device_to_user", dynlib: LIB_CAIRO.}
-proc device_to_user_distance*(cr: P, dx, dy: var float64){.cdecl, 
+proc device_to_user_distance*(cr: PCairo, dx, dy: var float64){.cdecl, 
     importc: "cairo_device_to_user_distance", dynlib: LIB_CAIRO.}
   #* Path creation functions
-proc new_path*(cr: P){.cdecl, importc: "cairo_new_path", dynlib: LIB_CAIRO.}
-proc move_to*(cr: P, x, y: float64){.cdecl, importc: "cairo_move_to", 
+proc new_path*(cr: PCairo){.cdecl, importc: "cairo_new_path", dynlib: LIB_CAIRO.}
+proc move_to*(cr: PCairo, x, y: float64){.cdecl, importc: "cairo_move_to", 
                                      dynlib: LIB_CAIRO.}
-proc new_sub_path*(cr: P){.cdecl, importc: "cairo_new_sub_path", 
+proc new_sub_path*(cr: PCairo){.cdecl, importc: "cairo_new_sub_path", 
                            dynlib: LIB_CAIRO.}
-proc line_to*(cr: P, x, y: float64){.cdecl, importc: "cairo_line_to", 
+proc line_to*(cr: PCairo, x, y: float64){.cdecl, importc: "cairo_line_to", 
                                      dynlib: LIB_CAIRO.}
-proc curve_to*(cr: P, x1, y1, x2, y2, x3, y3: float64){.cdecl, 
+proc curve_to*(cr: PCairo, x1, y1, x2, y2, x3, y3: float64){.cdecl, 
     importc: "cairo_curve_to", dynlib: LIB_CAIRO.}
-proc arc*(cr: P, xc, yc, radius, angle1, angle2: float64){.cdecl, 
+proc arc*(cr: PCairo, xc, yc, radius, angle1, angle2: float64){.cdecl, 
     importc: "cairo_arc", dynlib: LIB_CAIRO.}
-proc arc_negative*(cr: P, xc, yc, radius, angle1, angle2: float64){.cdecl, 
+proc arc_negative*(cr: PCairo, xc, yc, radius, angle1, angle2: float64){.cdecl, 
     importc: "cairo_arc_negative", dynlib: LIB_CAIRO.}
-proc rel_move_to*(cr: P, dx, dy: float64){.cdecl, importc: "cairo_rel_move_to", 
+proc rel_move_to*(cr: PCairo, dx, dy: float64){.cdecl, importc: "cairo_rel_move_to", 
     dynlib: LIB_CAIRO.}
-proc rel_line_to*(cr: P, dx, dy: float64){.cdecl, importc: "cairo_rel_line_to", 
+proc rel_line_to*(cr: PCairo, dx, dy: float64){.cdecl, importc: "cairo_rel_line_to", 
     dynlib: LIB_CAIRO.}
-proc rel_curve_to*(cr: P, dx1, dy1, dx2, dy2, dx3, dy3: float64){.cdecl, 
+proc rel_curve_to*(cr: PCairo, dx1, dy1, dx2, dy2, dx3, dy3: float64){.cdecl, 
     importc: "cairo_rel_curve_to", dynlib: LIB_CAIRO.}
-proc rectangle*(cr: P, x, y, width, height: float64){.cdecl, 
+proc rectangle*(cr: PCairo, x, y, width, height: float64){.cdecl, 
     importc: "cairo_rectangle", dynlib: LIB_CAIRO.}
-proc close_path*(cr: P){.cdecl, importc: "cairo_close_path", dynlib: LIB_CAIRO.}
+proc close_path*(cr: PCairo){.cdecl, importc: "cairo_close_path", dynlib: LIB_CAIRO.}
   #* Painting functions
-proc paint*(cr: P){.cdecl, importc: "cairo_paint", dynlib: LIB_CAIRO.}
-proc paint_with_alpha*(cr: P, alpha: float64){.cdecl, 
+proc paint*(cr: PCairo){.cdecl, importc: "cairo_paint", dynlib: LIB_CAIRO.}
+proc paint_with_alpha*(cr: PCairo, alpha: float64){.cdecl, 
     importc: "cairo_paint_with_alpha", dynlib: LIB_CAIRO.}
-proc mask*(cr: P, pattern: PPattern){.cdecl, importc: "cairo_mask", 
+proc mask*(cr: PCairo, pattern: PPattern){.cdecl, importc: "cairo_mask", 
                                       dynlib: LIB_CAIRO.}
-proc mask_surface*(cr: P, surface: PSurface, surface_x, surface_y: float64){.
+proc mask_surface*(cr: PCairo, surface: PSurface, surface_x, surface_y: float64){.
     cdecl, importc: "cairo_mask_surface", dynlib: LIB_CAIRO.}
-proc stroke*(cr: P){.cdecl, importc: "cairo_stroke", dynlib: LIB_CAIRO.}
-proc stroke_preserve*(cr: P){.cdecl, importc: "cairo_stroke_preserve", 
+proc stroke*(cr: PCairo){.cdecl, importc: "cairo_stroke", dynlib: LIB_CAIRO.}
+proc stroke_preserve*(cr: PCairo){.cdecl, importc: "cairo_stroke_preserve", 
                               dynlib: LIB_CAIRO.}
-proc fill*(cr: P){.cdecl, importc: "cairo_fill", dynlib: LIB_CAIRO.}
-proc fill_preserve*(cr: P){.cdecl, importc: "cairo_fill_preserve", 
+proc fill*(cr: PCairo){.cdecl, importc: "cairo_fill", dynlib: LIB_CAIRO.}
+proc fill_preserve*(cr: PCairo){.cdecl, importc: "cairo_fill_preserve", 
                             dynlib: LIB_CAIRO.}
-proc copy_page*(cr: P){.cdecl, importc: "cairo_copy_page", dynlib: LIB_CAIRO.}
-proc show_page*(cr: P){.cdecl, importc: "cairo_show_page", dynlib: LIB_CAIRO.}
+proc copy_page*(cr: PCairo){.cdecl, importc: "cairo_copy_page", dynlib: LIB_CAIRO.}
+proc show_page*(cr: PCairo){.cdecl, importc: "cairo_show_page", dynlib: LIB_CAIRO.}
   #* Insideness testing
-proc in_stroke*(cr: P, x, y: float64): TBool{.cdecl, importc: "cairo_in_stroke", 
+proc in_stroke*(cr: PCairo, x, y: float64): TBool{.cdecl, importc: "cairo_in_stroke", 
     dynlib: LIB_CAIRO.}
-proc in_fill*(cr: P, x, y: float64): TBool{.cdecl, importc: "cairo_in_fill", 
+proc in_fill*(cr: PCairo, x, y: float64): TBool{.cdecl, importc: "cairo_in_fill", 
     dynlib: LIB_CAIRO.}
   #* Rectangular extents
-proc stroke_extents*(cr: P, x1, y1, x2, y2: var float64){.cdecl, 
+proc stroke_extents*(cr: PCairo, x1, y1, x2, y2: var float64){.cdecl, 
     importc: "cairo_stroke_extents", dynlib: LIB_CAIRO.}
-proc fill_extents*(cr: P, x1, y1, x2, y2: var float64){.cdecl, 
+proc fill_extents*(cr: PCairo, x1, y1, x2, y2: var float64){.cdecl, 
     importc: "cairo_fill_extents", dynlib: LIB_CAIRO.}
   #* Clipping
-proc reset_clip*(cr: P){.cdecl, importc: "cairo_reset_clip", dynlib: LIB_CAIRO.}
-proc clip*(cr: P){.cdecl, importc: "cairo_clip", dynlib: LIB_CAIRO.}
-proc clip_preserve*(cr: P){.cdecl, importc: "cairo_clip_preserve", 
+proc reset_clip*(cr: PCairo){.cdecl, importc: "cairo_reset_clip", dynlib: LIB_CAIRO.}
+proc clip*(cr: PCairo){.cdecl, importc: "cairo_clip", dynlib: LIB_CAIRO.}
+proc clip_preserve*(cr: PCairo){.cdecl, importc: "cairo_clip_preserve", 
                             dynlib: LIB_CAIRO.}
-proc clip_extents*(cr: P, x1, y1, x2, y2: var float64){.cdecl, 
+proc clip_extents*(cr: PCairo, x1, y1, x2, y2: var float64){.cdecl, 
     importc: "cairo_clip_extents", dynlib: LIB_CAIRO.}
-proc copy_clip_rectangle_list*(cr: P): PRectangleList{.cdecl, 
+proc copy_clip_rectangle_list*(cr: PCairo): PRectangleList{.cdecl, 
     importc: "cairo_copy_clip_rectangle_list", dynlib: LIB_CAIRO.}
 proc rectangle_list_destroy*(rectangle_list: PRectangleList){.cdecl, 
     importc: "cairo_rectangle_list_destroy", dynlib: LIB_CAIRO.}
@@ -360,41 +360,41 @@ proc font_options_get_hint_metrics*(options: PFontOptions): THintMetrics{.cdecl,
     importc: "cairo_font_options_get_hint_metrics", dynlib: LIB_CAIRO.}
   #* This interface is for dealing with text as text, not caring about the
   #   font object inside the the TCairo.
-proc select_font_face*(cr: P, family: cstring, slant: TFontSlant, 
+proc select_font_face*(cr: PCairo, family: cstring, slant: TFontSlant, 
                        weight: TFontWeight){.cdecl, 
     importc: "cairo_select_font_face", dynlib: LIB_CAIRO.}
-proc set_font_size*(cr: P, size: float64){.cdecl, 
+proc set_font_size*(cr: PCairo, size: float64){.cdecl, 
     importc: "cairo_set_font_size", dynlib: LIB_CAIRO.}
-proc set_font_matrix*(cr: P, matrix: PMatrix){.cdecl, 
+proc set_font_matrix*(cr: PCairo, matrix: PMatrix){.cdecl, 
     importc: "cairo_set_font_matrix", dynlib: LIB_CAIRO.}
-proc get_font_matrix*(cr: P, matrix: PMatrix){.cdecl, 
+proc get_font_matrix*(cr: PCairo, matrix: PMatrix){.cdecl, 
     importc: "cairo_get_font_matrix", dynlib: LIB_CAIRO.}
-proc set_font_options*(cr: P, options: PFontOptions){.cdecl, 
+proc set_font_options*(cr: PCairo, options: PFontOptions){.cdecl, 
     importc: "cairo_set_font_options", dynlib: LIB_CAIRO.}
-proc get_font_options*(cr: P, options: PFontOptions){.cdecl, 
+proc get_font_options*(cr: PCairo, options: PFontOptions){.cdecl, 
     importc: "cairo_get_font_options", dynlib: LIB_CAIRO.}
-proc set_font_face*(cr: P, font_face: PFontFace){.cdecl, 
+proc set_font_face*(cr: PCairo, font_face: PFontFace){.cdecl, 
     importc: "cairo_set_font_face", dynlib: LIB_CAIRO.}
-proc get_font_face*(cr: P): PFontFace{.cdecl, importc: "cairo_get_font_face", 
+proc get_font_face*(cr: PCairo): PFontFace{.cdecl, importc: "cairo_get_font_face", 
                                        dynlib: LIB_CAIRO.}
-proc set_scaled_font*(cr: P, scaled_font: PScaledFont){.cdecl, 
+proc set_scaled_font*(cr: PCairo, scaled_font: PScaledFont){.cdecl, 
     importc: "cairo_set_scaled_font", dynlib: LIB_CAIRO.}
-proc get_scaled_font*(cr: P): PScaledFont{.cdecl, 
+proc get_scaled_font*(cr: PCairo): PScaledFont{.cdecl, 
     importc: "cairo_get_scaled_font", dynlib: LIB_CAIRO.}
-proc show_text*(cr: P, utf8: cstring){.cdecl, importc: "cairo_show_text", 
+proc show_text*(cr: PCairo, utf8: cstring){.cdecl, importc: "cairo_show_text", 
                                        dynlib: LIB_CAIRO.}
-proc show_glyphs*(cr: P, glyphs: PGlyph, num_glyphs: int32){.cdecl, 
+proc show_glyphs*(cr: PCairo, glyphs: PGlyph, num_glyphs: int32){.cdecl, 
     importc: "cairo_show_glyphs", dynlib: LIB_CAIRO.}
-proc text_path*(cr: P, utf8: cstring){.cdecl, importc: "cairo_text_path", 
+proc text_path*(cr: PCairo, utf8: cstring){.cdecl, importc: "cairo_text_path", 
                                        dynlib: LIB_CAIRO.}
-proc glyph_path*(cr: P, glyphs: PGlyph, num_glyphs: int32){.cdecl, 
+proc glyph_path*(cr: PCairo, glyphs: PGlyph, num_glyphs: int32){.cdecl, 
     importc: "cairo_glyph_path", dynlib: LIB_CAIRO.}
-proc text_extents*(cr: P, utf8: cstring, extents: PTextExtents){.cdecl, 
+proc text_extents*(cr: PCairo, utf8: cstring, extents: PTextExtents){.cdecl, 
     importc: "cairo_text_extents", dynlib: LIB_CAIRO.}
-proc glyph_extents*(cr: P, glyphs: PGlyph, num_glyphs: int32, 
+proc glyph_extents*(cr: PCairo, glyphs: PGlyph, num_glyphs: int32, 
                     extents: PTextExtents){.cdecl, 
     importc: "cairo_glyph_extents", dynlib: LIB_CAIRO.}
-proc font_extents*(cr: P, extents: PFontExtents){.cdecl, 
+proc font_extents*(cr: PCairo, extents: PFontExtents){.cdecl, 
     importc: "cairo_font_extents", dynlib: LIB_CAIRO.}
   #* Generic identifier for a font style
 proc font_face_reference*(font_face: PFontFace): PFontFace{.cdecl, 
@@ -449,46 +449,46 @@ proc scaled_font_get_font_options*(scaled_font: PScaledFont,
                                    options: PFontOptions){.cdecl, 
     importc: "cairo_scaled_font_get_font_options", dynlib: LIB_CAIRO.}
   #* Query functions
-proc get_operator*(cr: P): TOperator{.cdecl, importc: "cairo_get_operator", 
+proc get_operator*(cr: PCairo): TOperator{.cdecl, importc: "cairo_get_operator", 
                                       dynlib: LIB_CAIRO.}
-proc get_source*(cr: P): PPattern{.cdecl, importc: "cairo_get_source", 
+proc get_source*(cr: PCairo): PPattern{.cdecl, importc: "cairo_get_source", 
                                    dynlib: LIB_CAIRO.}
-proc get_tolerance*(cr: P): float64{.cdecl, importc: "cairo_get_tolerance", 
+proc get_tolerance*(cr: PCairo): float64{.cdecl, importc: "cairo_get_tolerance", 
                                      dynlib: LIB_CAIRO.}
-proc get_antialias*(cr: P): TAntialias{.cdecl, importc: "cairo_get_antialias", 
+proc get_antialias*(cr: PCairo): TAntialias{.cdecl, importc: "cairo_get_antialias", 
                                         dynlib: LIB_CAIRO.}
-proc get_current_point*(cr: P, x, y: var float64){.cdecl, 
+proc get_current_point*(cr: PCairo, x, y: var float64){.cdecl, 
     importc: "cairo_get_current_point", dynlib: LIB_CAIRO.}
-proc get_fill_rule*(cr: P): TFillRule{.cdecl, importc: "cairo_get_fill_rule", 
+proc get_fill_rule*(cr: PCairo): TFillRule{.cdecl, importc: "cairo_get_fill_rule", 
                                        dynlib: LIB_CAIRO.}
-proc get_line_width*(cr: P): float64{.cdecl, importc: "cairo_get_line_width", 
+proc get_line_width*(cr: PCairo): float64{.cdecl, importc: "cairo_get_line_width", 
                                       dynlib: LIB_CAIRO.}
-proc get_line_cap*(cr: P): TLineCap{.cdecl, importc: "cairo_get_line_cap", 
+proc get_line_cap*(cr: PCairo): TLineCap{.cdecl, importc: "cairo_get_line_cap", 
                                      dynlib: LIB_CAIRO.}
-proc get_line_join*(cr: P): TLineJoin{.cdecl, importc: "cairo_get_line_join", 
+proc get_line_join*(cr: PCairo): TLineJoin{.cdecl, importc: "cairo_get_line_join", 
                                        dynlib: LIB_CAIRO.}
-proc get_miter_limit*(cr: P): float64{.cdecl, importc: "cairo_get_miter_limit", 
+proc get_miter_limit*(cr: PCairo): float64{.cdecl, importc: "cairo_get_miter_limit", 
                                        dynlib: LIB_CAIRO.}
-proc get_dash_count*(cr: P): int32{.cdecl, importc: "cairo_get_dash_count", 
+proc get_dash_count*(cr: PCairo): int32{.cdecl, importc: "cairo_get_dash_count", 
                                     dynlib: LIB_CAIRO.}
-proc get_dash*(cr: P, dashes, offset: var float64){.cdecl, 
+proc get_dash*(cr: PCairo, dashes, offset: var float64){.cdecl, 
     importc: "cairo_get_dash", dynlib: LIB_CAIRO.}
-proc get_matrix*(cr: P, matrix: PMatrix){.cdecl, importc: "cairo_get_matrix", 
+proc get_matrix*(cr: PCairo, matrix: PMatrix){.cdecl, importc: "cairo_get_matrix", 
     dynlib: LIB_CAIRO.}
-proc get_target*(cr: P): PSurface{.cdecl, importc: "cairo_get_target", 
+proc get_target*(cr: PCairo): PSurface{.cdecl, importc: "cairo_get_target", 
                                    dynlib: LIB_CAIRO.}
-proc get_group_target*(cr: P): PSurface{.cdecl, 
+proc get_group_target*(cr: PCairo): PSurface{.cdecl, 
     importc: "cairo_get_group_target", dynlib: LIB_CAIRO.}
-proc copy_path*(cr: P): PPath{.cdecl, importc: "cairo_copy_path", 
+proc copy_path*(cr: PCairo): PPath{.cdecl, importc: "cairo_copy_path", 
                                dynlib: LIB_CAIRO.}
-proc copy_path_flat*(cr: P): PPath{.cdecl, importc: "cairo_copy_path_flat", 
+proc copy_path_flat*(cr: PCairo): PPath{.cdecl, importc: "cairo_copy_path_flat", 
                                     dynlib: LIB_CAIRO.}
-proc append_path*(cr: P, path: PPath){.cdecl, importc: "cairo_append_path", 
+proc append_path*(cr: PCairo, path: PPath){.cdecl, importc: "cairo_append_path", 
                                        dynlib: LIB_CAIRO.}
 proc path_destroy*(path: PPath){.cdecl, importc: "cairo_path_destroy", 
                                  dynlib: LIB_CAIRO.}
   #* Error status queries
-proc status*(cr: P): TStatus{.cdecl, importc: "cairo_status", dynlib: LIB_CAIRO.}
+proc status*(cr: PCairo): TStatus{.cdecl, importc: "cairo_status", dynlib: LIB_CAIRO.}
 proc status_to_string*(status: TStatus): cstring{.cdecl, 
     importc: "cairo_status_to_string", dynlib: LIB_CAIRO.}
   #* Surface manipulation
diff --git a/lib/newwrap/cairo/cairoft.nim b/lib/newwrap/cairo/cairoft.nim
index e80b9f82c..16a80e7f7 100755
--- a/lib/newwrap/cairo/cairoft.nim
+++ b/lib/newwrap/cairo/cairoft.nim
@@ -5,7 +5,7 @@
 #
 
 import 
-  , freetypeh
+  cairo, freetypeh
 
 #todo: properly define FcPattern:
 #It will require translate FontConfig header
@@ -32,4 +32,4 @@ proc ft_font_face_create_for_ft_face*(face: TFT_Face, load_flags: int32): PFontF
 proc ft_scaled_font_lock_face*(scaled_font: PScaledFont): TFT_Face{.cdecl, 
     importc: "cairo_ft_scaled_font_lock_face", dynlib: LIB_CAIRO.}
 proc ft_scaled_font_unlock_face*(scaled_font: PScaledFont){.cdecl, 
-    importc: "cairo_ft_scaled_font_unlock_face", dynlib: LIB_CAIRO.}
\ No newline at end of file
+    importc: "cairo_ft_scaled_font_unlock_face", dynlib: LIB_CAIRO.}
diff --git a/lib/newwrap/cairo/cairowin32.nim b/lib/newwrap/cairo/cairowin32.nim
index cee034902..cec3a5bc5 100755
--- a/lib/newwrap/cairo/cairowin32.nim
+++ b/lib/newwrap/cairo/cairowin32.nim
@@ -4,7 +4,7 @@
 #
 
 import 
-  , windows
+  cairo, windows
 
 proc win32_surface_create*(hdc: HDC): PSurface{.cdecl, 
     importc: "cairo_win32_surface_create", dynlib: LIB_CAIRO.}
diff --git a/lib/newwrap/cairo/cairoxlib.nim b/lib/newwrap/cairo/cairoxlib.nim
index a889d7a9b..861c55527 100755
--- a/lib/newwrap/cairo/cairoxlib.nim
+++ b/lib/newwrap/cairo/cairoxlib.nim
@@ -5,7 +5,7 @@
 #
 
 import 
-  , x, xlib, xrender
+  cairo, x, xlib, xrender
 
 proc xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, visual: PVisual, 
                           width, height: int32): PSurface{.cdecl, 
diff --git a/lib/newwrap/gtk/atk.nim b/lib/newwrap/gtk/atk.nim
index 9c0a1cb86..0178ade6f 100755
--- a/lib/newwrap/gtk/atk.nim
+++ b/lib/newwrap/gtk/atk.nim
@@ -462,7 +462,7 @@ proc role_register*(name: cstring): TRole{.cdecl, dynlib: lib,
 proc object_get_type*(): GType{.cdecl, dynlib: lib, 
                                 importc: "atk_object_get_type".}
 proc TYPE_OBJECT*(): GType
-proc OBJECT*(obj: pointer): PObject
+proc `OBJECT`*(obj: pointer): PObject
 proc OBJECT_CLASS*(klass: pointer): PObjectClass
 proc IS_OBJECT*(obj: pointer): bool
 proc IS_OBJECT_CLASS*(klass: pointer): bool
@@ -983,7 +983,7 @@ proc value_set_current_value*(obj: PValue, value: PGValue): gboolean{.cdecl,
 proc TYPE_OBJECT*(): GType = 
   result = object_get_type()
 
-proc OBJECT*(obj: pointer): PObject = 
+proc `OBJECT`*(obj: pointer): PObject = 
   result = cast[PObject](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_OBJECT()))
 
 proc OBJECT_CLASS*(klass: pointer): PObjectClass = 
diff --git a/lib/newwrap/gtk/gdk2.nim b/lib/newwrap/gtk/gdk2.nim
index c171068d3..f2e12ab24 100755
--- a/lib/newwrap/gtk/gdk2.nim
+++ b/lib/newwrap/gtk/gdk2.nim
@@ -1,6 +1,6 @@
 {.deadCodeElim: on.}
 import 
-  glib2, 2pixbuf, pango
+  glib2, gdk2pixbuf, pango
 
 when defined(win32): 
   const 
@@ -56,8 +56,9 @@ type
 
   PFunction* = ptr TFunction
   TFunction* = enum 
-    COPY, INVERT, XOR, CLEAR, AND, AND_REVERSE, AND_INVERT, NOOP, OR, EQUIV, 
-    OR_REVERSE, COPY_INVERT, OR_INVERT, NAND, NOR, SET
+    funcCOPY, funcINVERT, funcXOR, funcCLEAR, funcAND, 
+    funcAND_REVERSE, funcAND_INVERT, funcNOOP, funcOR, funcEQUIV, 
+    funcOR_REVERSE, funcCOPY_INVERT, funcOR_INVERT, funcNAND, funcNOR, funcSET
   PCapStyle* = ptr TCapStyle
   TCapStyle* = enum 
     CAP_NOT_LAST, CAP_BUTT, CAP_ROUND, CAP_PROJECTING
@@ -109,7 +110,7 @@ type
   PImage* = ptr TImage
   PDevice* = ptr TDevice
   PTimeCoord* = ptr TTimeCoord
-  PPGdkTimeCoord* = ptr PTimeCoord
+  PPTimeCoord* = ptr PTimeCoord
   PRgbDither* = ptr TRgbDither
   TRgbDither* = enum 
     RGB_DITHER_NONE, RGB_DITHER_NORMAL, RGB_DITHER_MAX
@@ -125,7 +126,7 @@ type
     y*: gint
 
   PPoint* = ptr TPoint
-  PPGdkPoint* = ptr PPoint
+  PPPoint* = ptr PPoint
   PSpan* = ptr TSpan
   PWChar* = ptr TWChar
   TWChar* = guint32
@@ -247,8 +248,8 @@ type
                           nsegs: gint){.cdecl.}
     draw_lines*: proc (drawable: PDrawable, gc: PGC, points: PPoint, 
                        npoints: gint){.cdecl.}
-    draw_glyphs*: proc (drawable: PDrawable, gc: PGC, font: PPangoFont, x: gint, 
-                        y: gint, glyphs: PPangoGlyphString){.cdecl.}
+    draw_glyphs*: proc (drawable: PDrawable, gc: PGC, font: PFont, x: gint, 
+                        y: gint, glyphs: PGlyphString){.cdecl.}
     draw_image*: proc (drawable: PDrawable, gc: PGC, image: PImage, xsrc: gint, 
                        ysrc: gint, xdest: gint, ydest: gint, width: gint, 
                        height: gint){.cdecl.}
@@ -509,25 +510,25 @@ type
 
   TEvent*{.final, pure.} = object 
     data*: array[0..255, char] # union of
-                               # `type`: TGdkEventType
-                               #  any: TGdkEventAny
-                               #  expose: TGdkEventExpose
-                               #  no_expose: TGdkEventNoExpose
-                               #  visibility: TGdkEventVisibility
-                               #  motion: TGdkEventMotion
-                               #  button: TGdkEventButton
-                               #  scroll: TGdkEventScroll
-                               #  key: TGdkEventKey
-                               #  crossing: TGdkEventCrossing
-                               #  focus_change: TGdkEventFocus
-                               #  configure: TGdkEventConfigure
-                               #  `property`: TGdkEventProperty
-                               #  selection: TGdkEventSelection
-                               #  proximity: TGdkEventProximity
-                               #  client: TGdkEventClient
-                               #  dnd: TGdkEventDND
-                               #  window_state: TGdkEventWindowState
-                               #  setting: TGdkEventSetting
+                               # `type`: TEventType
+                               #  any: TEventAny
+                               #  expose: TEventExpose
+                               #  no_expose: TEventNoExpose
+                               #  visibility: TEventVisibility
+                               #  motion: TEventMotion
+                               #  button: TEventButton
+                               #  scroll: TEventScroll
+                               #  key: TEventKey
+                               #  crossing: TEventCrossing
+                               #  focus_change: TEventFocus
+                               #  configure: TEventConfigure
+                               #  `property`: TEventProperty
+                               #  selection: TEventSelection
+                               #  proximity: TEventProximity
+                               #  client: TEventClient
+                               #  dnd: TEventDND
+                               #  window_state: TEventWindowState
+                               #  setting: TEventSetting
   
   PGCClass* = ptr TGCClass
   TGCClass* = object of TGObjectClass
@@ -606,14 +607,14 @@ type
   TKeymapClass* = object of TGObjectClass
     direction_changed*: proc (keymap: PKeymap){.cdecl.}
 
-  PPangoAttrStipple* = ptr TPangoAttrStipple
-  TPangoAttrStipple*{.final, pure.} = object 
-    attr*: TPangoAttribute
+  PAttrStipple* = ptr TAttrStipple
+  TAttrStipple*{.final, pure.} = object 
+    attr*: TAttribute
     stipple*: PBitmap
 
-  PPangoAttrEmbossed* = ptr TPangoAttrEmbossed
-  TPangoAttrEmbossed*{.final, pure.} = object 
-    attr*: TPangoAttribute
+  PAttrEmbossed* = ptr TAttrEmbossed
+  TAttrEmbossed*{.final, pure.} = object 
+    attr*: TAttribute
     embossed*: gboolean
 
   PPixmapObject* = ptr TPixmapObject
@@ -1004,21 +1005,21 @@ proc draw_segments*(drawable: PDrawable, gc: PGC, segs: PSegment, nsegs: gint){.
     cdecl, dynlib: lib, importc: "gdk_draw_segments".}
 proc draw_lines*(drawable: PDrawable, gc: PGC, points: PPoint, npoints: gint){.
     cdecl, dynlib: lib, importc: "gdk_draw_lines".}
-proc draw_glyphs*(drawable: PDrawable, gc: PGC, font: PPangoFont, x: gint, 
-                  y: gint, glyphs: PPangoGlyphString){.cdecl, dynlib: lib, 
+proc draw_glyphs*(drawable: PDrawable, gc: PGC, font: PFont, x: gint, 
+                  y: gint, glyphs: PGlyphString){.cdecl, dynlib: lib, 
     importc: "gdk_draw_glyphs".}
 proc draw_layout_line*(drawable: PDrawable, gc: PGC, x: gint, y: gint, 
-                       line: PPangoLayoutLine){.cdecl, dynlib: lib, 
+                       line: PLayoutLine){.cdecl, dynlib: lib, 
     importc: "gdk_draw_layout_line".}
 proc draw_layout*(drawable: PDrawable, gc: PGC, x: gint, y: gint, 
-                  layout: PPangoLayout){.cdecl, dynlib: lib, 
+                  layout: PLayout){.cdecl, dynlib: lib, 
     importc: "gdk_draw_layout".}
 proc draw_layout_line_with_colors*(drawable: PDrawable, gc: PGC, x: gint, 
-                                   y: gint, line: PPangoLayoutLine, 
+                                   y: gint, line: PLayoutLine, 
                                    foreground: PColor, background: PColor){.
     cdecl, dynlib: lib, importc: "gdk_draw_layout_line_with_colors".}
 proc draw_layout_with_colors*(drawable: PDrawable, gc: PGC, x: gint, y: gint, 
-                              layout: PPangoLayout, foreground: PColor, 
+                              layout: PLayout, foreground: PColor, 
                               background: PColor){.cdecl, dynlib: lib, 
     importc: "gdk_draw_layout_with_colors".}
 proc drawable_get_image*(drawable: PDrawable, x: gint, y: gint, width: gint, 
@@ -1035,8 +1036,8 @@ const
   EXPOSE* = 2
   MOTION_NOTIFY* = 3
   BUTTON_PRESS* = 4
-  2BUTTON_PRESS* = 5
-  3BUTTON_PRESS* = 6
+  BUTTON2_PRESS* = 5
+  BUTTON3_PRESS* = 6
   BUTTON_RELEASE* = 7
   KEY_PRESS* = 8
   KEY_RELEASE* = 9
@@ -1137,7 +1138,7 @@ proc font_load_for_display*(display: PDisplay, font_name: cstring): PFont{.
 proc fontset_load_for_display*(display: PDisplay, fontset_name: cstring): PFont{.
     cdecl, dynlib: lib, importc: "gdk_fontset_load_for_display".}
 proc font_from_description_for_display*(display: PDisplay, 
-                                        font_desc: PPangoFontDescription): PFont{.
+                                        font_desc: PFontDescription): PFont{.
     cdecl, dynlib: lib, importc: "gdk_font_from_description_for_display".}
 proc font_ref*(font: PFont): PFont{.cdecl, dynlib: lib, importc: "gdk_font_ref".}
 proc font_unref*(font: PFont){.cdecl, dynlib: lib, importc: "gdk_font_unref".}
@@ -1311,9 +1312,9 @@ proc device_get_state*(device: PDevice, window: PWindow, axes: Pgdouble,
                        mask: PModifierType){.cdecl, dynlib: lib, 
     importc: "gdk_device_get_state".}
 proc device_get_history*(device: PDevice, window: PWindow, start: guint32, 
-                         stop: guint32, s: var PPGdkTimeCoord, n_events: Pgint): gboolean{.
+                         stop: guint32, s: var PPTimeCoord, n_events: Pgint): gboolean{.
     cdecl, dynlib: lib, importc: "gdk_device_get_history".}
-proc device_free_history*(events: PPGdkTimeCoord, n_events: gint){.cdecl, 
+proc device_free_history*(events: PPTimeCoord, n_events: gint){.cdecl, 
     dynlib: lib, importc: "gdk_device_free_history".}
 proc device_get_axis*(device: PDevice, axes: Pgdouble, use: TAxisUse, 
                       value: Pgdouble): gboolean{.cdecl, dynlib: lib, 
@@ -1348,7 +1349,7 @@ proc keymap_get_entries_for_keycode*(keymap: PKeymap, hardware_keycode: guint,
                                      s: var PKeymapKey, sasdf: var Pguint, 
                                      n_entries: Pgint): gboolean{.cdecl, 
     dynlib: lib, importc: "gdk_keymap_get_entries_for_keycode".}
-proc keymap_get_direction*(keymap: PKeymap): TPangoDirection{.cdecl, 
+proc keymap_get_direction*(keymap: PKeymap): TDirection{.cdecl, 
     dynlib: lib, importc: "gdk_keymap_get_direction".}
 proc keyval_name*(keyval: guint): cstring{.cdecl, dynlib: lib, 
     importc: "gdk_keyval_name".}
@@ -2703,21 +2704,21 @@ const
   KEY_DongSign* = 0x000020AB
   KEY_EuroSign* = 0x000020AC
 
-proc pango_context_get_for_screen*(screen: PScreen): PPangoContext{.cdecl, 
+proc pango_context_get_for_screen*(screen: PScreen): PContext{.cdecl, 
     dynlib: lib, importc: "gdk_pango_context_get_for_screen".}
-proc pango_context_set_colormap*(context: PPangoContext, colormap: PColormap){.
+proc pango_context_set_colormap*(context: PContext, colormap: PColormap){.
     cdecl, dynlib: lib, importc: "gdk_pango_context_set_colormap".}
-proc pango_layout_line_get_clip_region*(line: PPangoLayoutLine, x_origin: gint, 
+proc pango_layout_line_get_clip_region*(line: PLayoutLine, x_origin: gint, 
                                         y_origin: gint, index_ranges: Pgint, 
                                         n_ranges: gint): PRegion{.cdecl, 
     dynlib: lib, importc: "gdk_pango_layout_line_get_clip_region".}
-proc pango_layout_get_clip_region*(layout: PPangoLayout, x_origin: gint, 
+proc pango_layout_get_clip_region*(layout: PLayout, x_origin: gint, 
                                    y_origin: gint, index_ranges: Pgint, 
                                    n_ranges: gint): PRegion{.cdecl, dynlib: lib, 
     importc: "gdk_pango_layout_get_clip_region".}
-proc pango_attr_stipple_new*(stipple: PBitmap): PPangoAttribute{.cdecl, 
+proc pango_attr_stipple_new*(stipple: PBitmap): PAttribute{.cdecl, 
     dynlib: lib, importc: "gdk_pango_attr_stipple_new".}
-proc pango_attr_embossed_new*(embossed: gboolean): PPangoAttribute{.cdecl, 
+proc pango_attr_embossed_new*(embossed: gboolean): PAttribute{.cdecl, 
     dynlib: lib, importc: "gdk_pango_attr_embossed_new".}
 proc pixbuf_render_threshold_alpha*(pixbuf: PPixbuf, bitmap: PBitmap, 
                                     src_x: int32, src_y: int32, dest_x: int32, 
@@ -3125,14 +3126,14 @@ proc IS_WINDOW_CLASS*(klass: Pointer): bool
 proc WINDOW_GET_CLASS*(obj: Pointer): PWindowObjectClass
 proc WINDOW_OBJECT*(anObject: Pointer): PWindowObject
 const 
-  bm_TGdkWindowObject_guffaw_gravity* = 0x0001'i16
-  bp_TGdkWindowObject_guffaw_gravity* = 0'i16
-  bm_TGdkWindowObject_input_only* = 0x0002'i16
-  bp_TGdkWindowObject_input_only* = 1'i16
-  bm_TGdkWindowObject_modal_hint* = 0x0004'i16
-  bp_TGdkWindowObject_modal_hint* = 2'i16
-  bm_TGdkWindowObject_destroyed* = 0x0018'i16
-  bp_TGdkWindowObject_destroyed* = 3'i16
+  bm_TWindowObject_guffaw_gravity* = 0x0001'i16
+  bp_TWindowObject_guffaw_gravity* = 0'i16
+  bm_TWindowObject_input_only* = 0x0002'i16
+  bp_TWindowObject_input_only* = 1'i16
+  bm_TWindowObject_modal_hint* = 0x0004'i16
+  bp_TWindowObject_modal_hint* = 2'i16
+  bm_TWindowObject_destroyed* = 0x0018'i16
+  bp_TWindowObject_destroyed* = 3'i16
 
 proc WindowObject_guffaw_gravity*(a: var TWindowObject): guint
 proc WindowObject_set_guffaw_gravity*(a: var TWindowObject, 
@@ -3802,41 +3803,41 @@ proc WINDOW_OBJECT*(anObject: Pointer): PWindowObject =
   result = cast[PWindowObject](WINDOW(anObject))
 
 proc WindowObject_guffaw_gravity*(a: var TWindowObject): guint = 
-  result = (a.flag0 and bm_TGdkWindowObject_guffaw_gravity) shr
-      bp_TGdkWindowObject_guffaw_gravity
+  result = (a.flag0 and bm_TWindowObject_guffaw_gravity) shr
+      bp_TWindowObject_guffaw_gravity
 
 proc WindowObject_set_guffaw_gravity*(a: var TWindowObject, 
                                       `guffaw_gravity`: guint) = 
   a.flag0 = a.flag0 or
-      (int16(`guffaw_gravity` shl bp_TGdkWindowObject_guffaw_gravity) and
-      bm_TGdkWindowObject_guffaw_gravity)
+      (int16(`guffaw_gravity` shl bp_TWindowObject_guffaw_gravity) and
+      bm_TWindowObject_guffaw_gravity)
 
 proc WindowObject_input_only*(a: var TWindowObject): guint = 
-  result = (a.flag0 and bm_TGdkWindowObject_input_only) shr
-      bp_TGdkWindowObject_input_only
+  result = (a.flag0 and bm_TWindowObject_input_only) shr
+      bp_TWindowObject_input_only
 
 proc WindowObject_set_input_only*(a: var TWindowObject, `input_only`: guint) = 
   a.flag0 = a.flag0 or
-      (int16(`input_only` shl bp_TGdkWindowObject_input_only) and
-      bm_TGdkWindowObject_input_only)
+      (int16(`input_only` shl bp_TWindowObject_input_only) and
+      bm_TWindowObject_input_only)
 
 proc WindowObject_modal_hint*(a: var TWindowObject): guint = 
-  result = (a.flag0 and bm_TGdkWindowObject_modal_hint) shr
-      bp_TGdkWindowObject_modal_hint
+  result = (a.flag0 and bm_TWindowObject_modal_hint) shr
+      bp_TWindowObject_modal_hint
 
 proc WindowObject_set_modal_hint*(a: var TWindowObject, `modal_hint`: guint) = 
   a.flag0 = a.flag0 or
-      (int16(`modal_hint` shl bp_TGdkWindowObject_modal_hint) and
-      bm_TGdkWindowObject_modal_hint)
+      (int16(`modal_hint` shl bp_TWindowObject_modal_hint) and
+      bm_TWindowObject_modal_hint)
 
 proc WindowObject_destroyed*(a: var TWindowObject): guint = 
-  result = (a.flag0 and bm_TGdkWindowObject_destroyed) shr
-      bp_TGdkWindowObject_destroyed
+  result = (a.flag0 and bm_TWindowObject_destroyed) shr
+      bp_TWindowObject_destroyed
 
 proc WindowObject_set_destroyed*(a: var TWindowObject, `destroyed`: guint) = 
   a.flag0 = a.flag0 or
-      (int16(`destroyed` shl bp_TGdkWindowObject_destroyed) and
-      bm_TGdkWindowObject_destroyed)
+      (int16(`destroyed` shl bp_TWindowObject_destroyed) and
+      bm_TWindowObject_destroyed)
 
 proc ROOT_PARENT*(): PWindow = 
   result = get_default_root_window()
diff --git a/lib/newwrap/gtk/gtk2.nim b/lib/newwrap/gtk/gtk2.nim
index 3c1eed666..bef2f5b83 100755
--- a/lib/newwrap/gtk/gtk2.nim
+++ b/lib/newwrap/gtk/gtk2.nim
@@ -18,8 +18,6 @@ elif defined(darwin):
 else: 
   const 
     lib = "libgtk-x11-2.0.so"
-type 
-  PPPchar* = PPPgchar
 
 const 
   MAX_COMPOSE_LEN* = 7
@@ -186,7 +184,7 @@ type
   TWidgetHelpType* = enum 
     WIDGET_HELP_TOOLTIP, WIDGET_HELP_WHATS_THIS
   PAllocation* = ptr TAllocation
-  TAllocation* = TGdkRectangle
+  TAllocation* = Gdk2.TRectangle
   TCallback* = proc (widget: PWidget, data: gpointer){.cdecl.}
   PRequisition* = ptr TRequisition
   TRequisition*{.final, pure.} = object 
@@ -201,7 +199,7 @@ type
     style*: PStyle
     requisition*: TRequisition
     allocation*: TAllocation
-    window*: PGdkWindow
+    window*: Gdk2.PWindow
     parent*: PWidget
 
   PWidgetClass* = ptr TWidgetClass
@@ -233,78 +231,78 @@ type
         cdecl.}
     grab_focus*: proc (widget: PWidget){.cdecl.}
     focus*: proc (widget: PWidget, direction: TDirectionType): gboolean{.cdecl.}
-    event*: proc (widget: PWidget, event: PGdkEvent): gboolean{.cdecl.}
-    button_press_event*: proc (widget: PWidget, event: PGdkEventButton): gboolean{.
+    event*: proc (widget: PWidget, event: Gdk2.PEvent): gboolean{.cdecl.}
+    button_press_event*: proc (widget: PWidget, event: PEventButton): gboolean{.
         cdecl.}
-    button_release_event*: proc (widget: PWidget, event: PGdkEventButton): gboolean{.
+    button_release_event*: proc (widget: PWidget, event: PEventButton): gboolean{.
         cdecl.}
-    scroll_event*: proc (widget: PWidget, event: PGdkEventScroll): gboolean{.
+    scroll_event*: proc (widget: PWidget, event: PEventScroll): gboolean{.
         cdecl.}
-    motion_notify_event*: proc (widget: PWidget, event: PGdkEventMotion): gboolean{.
+    motion_notify_event*: proc (widget: PWidget, event: PEventMotion): gboolean{.
         cdecl.}
-    delete_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.}
-    destroy_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.}
-    expose_event*: proc (widget: PWidget, event: PGdkEventExpose): gboolean{.
+    delete_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.}
+    destroy_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.}
+    expose_event*: proc (widget: PWidget, event: PEventExpose): gboolean{.
         cdecl.}
-    key_press_event*: proc (widget: PWidget, event: PGdkEventKey): gboolean{.
+    key_press_event*: proc (widget: PWidget, event: PEventKey): gboolean{.
         cdecl.}
-    key_release_event*: proc (widget: PWidget, event: PGdkEventKey): gboolean{.
+    key_release_event*: proc (widget: PWidget, event: PEventKey): gboolean{.
         cdecl.}
-    enter_notify_event*: proc (widget: PWidget, event: PGdkEventCrossing): gboolean{.
+    enter_notify_event*: proc (widget: PWidget, event: PEventCrossing): gboolean{.
         cdecl.}
-    leave_notify_event*: proc (widget: PWidget, event: PGdkEventCrossing): gboolean{.
+    leave_notify_event*: proc (widget: PWidget, event: PEventCrossing): gboolean{.
         cdecl.}
-    configure_event*: proc (widget: PWidget, event: PGdkEventConfigure): gboolean{.
+    configure_event*: proc (widget: PWidget, event: PEventConfigure): gboolean{.
         cdecl.}
-    focus_in_event*: proc (widget: PWidget, event: PGdkEventFocus): gboolean{.
+    focus_in_event*: proc (widget: PWidget, event: PEventFocus): gboolean{.
         cdecl.}
-    focus_out_event*: proc (widget: PWidget, event: PGdkEventFocus): gboolean{.
+    focus_out_event*: proc (widget: PWidget, event: PEventFocus): gboolean{.
         cdecl.}
-    map_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.}
-    unmap_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.}
-    property_notify_event*: proc (widget: PWidget, event: PGdkEventProperty): gboolean{.
+    map_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.}
+    unmap_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.}
+    property_notify_event*: proc (widget: PWidget, event: PEventProperty): gboolean{.
         cdecl.}
-    selection_clear_event*: proc (widget: PWidget, event: PGdkEventSelection): gboolean{.
+    selection_clear_event*: proc (widget: PWidget, event: PEventSelection): gboolean{.
         cdecl.}
-    selection_request_event*: proc (widget: PWidget, event: PGdkEventSelection): gboolean{.
+    selection_request_event*: proc (widget: PWidget, event: PEventSelection): gboolean{.
         cdecl.}
-    selection_notify_event*: proc (widget: PWidget, event: PGdkEventSelection): gboolean{.
+    selection_notify_event*: proc (widget: PWidget, event: PEventSelection): gboolean{.
         cdecl.}
-    proximity_in_event*: proc (widget: PWidget, event: PGdkEventProximity): gboolean{.
+    proximity_in_event*: proc (widget: PWidget, event: PEventProximity): gboolean{.
         cdecl.}
-    proximity_out_event*: proc (widget: PWidget, event: PGdkEventProximity): gboolean{.
+    proximity_out_event*: proc (widget: PWidget, event: PEventProximity): gboolean{.
         cdecl.}
-    visibility_notify_event*: proc (widget: PWidget, event: PGdkEventVisibility): gboolean{.
+    visibility_notify_event*: proc (widget: PWidget, event: PEventVisibility): gboolean{.
         cdecl.}
-    client_event*: proc (widget: PWidget, event: PGdkEventClient): gboolean{.
+    client_event*: proc (widget: PWidget, event: PEventClient): gboolean{.
         cdecl.}
-    no_expose_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.
+    no_expose_event*: proc (widget: PWidget, event: PEventAny): gboolean{.
         cdecl.}
-    window_state_event*: proc (widget: PWidget, event: PGdkEventWindowState): gboolean{.
+    window_state_event*: proc (widget: PWidget, event: PEventWindowState): gboolean{.
         cdecl.}
     selection_get*: proc (widget: PWidget, selection_data: PSelectionData, 
                           info: guint, time: guint){.cdecl.}
     selection_received*: proc (widget: PWidget, selection_data: PSelectionData, 
                                time: guint){.cdecl.}
-    drag_begin*: proc (widget: PWidget, context: PGdkDragContext){.cdecl.}
-    drag_end*: proc (widget: PWidget, context: PGdkDragContext){.cdecl.}
-    drag_data_get*: proc (widget: PWidget, context: PGdkDragContext, 
+    drag_begin*: proc (widget: PWidget, context: PDragContext){.cdecl.}
+    drag_end*: proc (widget: PWidget, context: PDragContext){.cdecl.}
+    drag_data_get*: proc (widget: PWidget, context: PDragContext, 
                           selection_data: PSelectionData, info: guint, 
                           time: guint){.cdecl.}
-    drag_data_delete*: proc (widget: PWidget, context: PGdkDragContext){.cdecl.}
-    drag_leave*: proc (widget: PWidget, context: PGdkDragContext, time: guint){.
+    drag_data_delete*: proc (widget: PWidget, context: PDragContext){.cdecl.}
+    drag_leave*: proc (widget: PWidget, context: PDragContext, time: guint){.
         cdecl.}
-    drag_motion*: proc (widget: PWidget, context: PGdkDragContext, x: gint, 
+    drag_motion*: proc (widget: PWidget, context: PDragContext, x: gint, 
                         y: gint, time: guint): gboolean{.cdecl.}
-    drag_drop*: proc (widget: PWidget, context: PGdkDragContext, x: gint, 
+    drag_drop*: proc (widget: PWidget, context: PDragContext, x: gint, 
                       y: gint, time: guint): gboolean{.cdecl.}
-    drag_data_received*: proc (widget: PWidget, context: PGdkDragContext, 
+    drag_data_received*: proc (widget: PWidget, context: PDragContext, 
                                x: gint, y: gint, selection_data: PSelectionData, 
                                info: guint, time: guint){.cdecl.}
     popup_menu*: proc (widget: PWidget): gboolean{.cdecl.}
     show_help*: proc (widget: PWidget, help_type: TWidgetHelpType): gboolean{.
         cdecl.}
-    get_accessible*: proc (widget: PWidget): PAtkObject{.cdecl.}
+    get_accessible*: proc (widget: PWidget): atk.PObject{.cdecl.}
     reserved1: proc (){.cdecl.}
     reserved2: proc (){.cdecl.}
     reserved3: proc (){.cdecl.}
@@ -326,7 +324,7 @@ type
   TWidgetShapeInfo*{.final, pure.} = object 
     offset_x*: gint16
     offset_y*: gint16
-    shape_mask*: PGdkBitmap
+    shape_mask*: gdk2.PBitmap
 
   TMisc* = object of TWidget
     xalign*: gfloat
@@ -342,10 +340,10 @@ type
   PAccelGroupEntry* = ptr TAccelGroupEntry
   TAccelGroupActivate* = proc (accel_group: PAccelGroup, 
                                acceleratable: PGObject, keyval: guint, 
-                               modifier: TGdkModifierType): gboolean{.cdecl.}
+                               modifier: gdk2.TModifierType): gboolean{.cdecl.}
   TAccelGroup* = object of TGObject
     lock_count*: guint
-    modifier_mask*: TGdkModifierType
+    modifier_mask*: gdk2.TModifierType
     acceleratables*: PGSList
     n_accels*: guint
     priv_accels*: PAccelGroupEntry
@@ -353,7 +351,7 @@ type
   PAccelGroupClass* = ptr TAccelGroupClass
   TAccelGroupClass* = object of TGObjectClass
     accel_changed*: proc (accel_group: PAccelGroup, keyval: guint, 
-                          modifier: TGdkModifierType, accel_closure: PGClosure){.
+                          modifier: gdk2.TModifierType, accel_closure: PGClosure){.
         cdecl.}
     reserved1: proc (){.cdecl.}
     reserved2: proc (){.cdecl.}
@@ -363,7 +361,7 @@ type
   PAccelKey* = ptr TAccelKey
   TAccelKey*{.final, pure.} = object 
     accel_key*: guint
-    accel_mods*: TGdkModifierType
+    accel_mods*: gdk2.TModifierType
     flag0*: guint16
 
   TAccelGroupEntry*{.final, pure.} = object 
@@ -418,7 +416,7 @@ type
     default_widget*: PWidget
     transient_parent*: PWindow
     geometry_info*: PWindowGeometryInfo
-    frame*: PGdkWindow
+    frame*: gdk2.PWindow
     group*: PWindowGroup
     configure_request_count*: guint16
     window_flag0*: int32
@@ -427,13 +425,13 @@ type
     frame_right*: guint
     frame_bottom*: guint
     keys_changed_handler*: guint
-    mnemonic_modifier*: TGdkModifierType
-    screen*: PGdkScreen
+    mnemonic_modifier*: gdk2.TModifierType
+    screen*: gdk2.PScreen
 
   PWindowClass* = ptr TWindowClass
   TWindowClass* = object of TBinClass
     set_focus*: proc (window: PWindow, focus: PWidget){.cdecl.}
-    frame_event*: proc (window: PWindow, event: PGdkEvent): gboolean{.cdecl.}
+    frame_event*: proc (window: PWindow, event: gdk2.PEvent): gboolean{.cdecl.}
     activate_focus*: proc (window: PWindow){.cdecl.}
     activate_default*: proc (window: PWindow){.cdecl.}
     move_focus*: proc (window: PWindow, direction: TDirectionType){.cdecl.}
@@ -454,7 +452,7 @@ type
     reserved43: proc (){.cdecl.}
 
   TWindowKeysForeachFunc* = proc (window: PWindow, keyval: guint, 
-                                  modifiers: TGdkModifierType, 
+                                  modifiers: gdk2.TModifierType, 
                                   is_mnemonic: gboolean, data: gpointer){.cdecl.}
   PLabelSelectionInfo* = pointer
   TLabel* = object of TMisc
@@ -462,9 +460,9 @@ type
     Label_flag0*: guint16
     mnemonic_keyval*: guint
     text*: cstring
-    attrs*: PPangoAttrList
-    effective_attrs*: PPangoAttrList
-    layout*: PPangoLayout
+    attrs*: pango.PAttrList
+    effective_attrs*: pango.PAttrList
+    layout*: pango.PLayout
     mnemonic_widget*: PWidget
     mnemonic_window*: PWindow
     select_info*: PLabelSelectionInfo
@@ -506,14 +504,14 @@ type
     reserved64: proc (){.cdecl.}
 
   TAccelMapForeach* = proc (data: gpointer, accel_path: cstring, 
-                            accel_key: guint, accel_mods: TGdkModifierType, 
+                            accel_key: guint, accel_mods: gdk2.TModifierType, 
                             changed: gboolean){.cdecl.}
   PAccessible* = ptr TAccessible
-  TAccessible* = object of TAtkObject
+  TAccessible* = object of atk.TObject
     widget*: PWidget
 
   PAccessibleClass* = ptr TAccessibleClass
-  TAccessibleClass* = object of TAtkObjectClass
+  TAccessibleClass* = object of atk.TObjectClass
     connect_widget_destroyed*: proc (accessible: PAccessible){.cdecl.}
     reserved71: proc (){.cdecl.}
     reserved72: proc (){.cdecl.}
@@ -593,7 +591,7 @@ type
 
   TBindingEntry*{.final, pure.} = object 
     keyval*: guint
-    modifiers*: TGdkModifierType
+    modifiers*: gdk2.TModifierType
     binding_set*: PBindingSet
     flag0*: guint16
     set_next*: PBindingEntry
@@ -636,7 +634,7 @@ type
   TButtonBoxClass* = object of TBoxClass
   PButton* = ptr TButton
   TButton* = object of TBin
-    event_window*: PGdkWindow
+    event_window*: gdk2.PWindow
     label_text*: cstring
     activate_timeout*: guint
     button_flag0*: guint16
@@ -668,9 +666,9 @@ type
     num_marked_dates*: gint
     marked_date*: array[0..30, gint]
     display_flags*: TCalendarDisplayOptions
-    marked_date_color*: array[0..30, TGdkColor]
-    gc*: PGdkGC
-    xor_gc*: PGdkGC
+    marked_date_color*: array[0..30, gdk2.TColor]
+    gc*: gdk2.PGC
+    xor_gc*: gdk2.PGC
     focus_row*: gint
     focus_col*: gint
     highlight_row*: gint
@@ -697,7 +695,7 @@ type
   TCellEditableIface* = object of TGTypeInterface
     editing_done*: proc (cell_editable: PCellEditable){.cdecl.}
     remove_widget*: proc (cell_editable: PCellEditable){.cdecl.}
-    start_editing*: proc (cell_editable: PCellEditable, event: PGdkEvent){.cdecl.}
+    start_editing*: proc (cell_editable: PCellEditable, event: gdk2.PEvent){.cdecl.}
 
   PCellRendererState* = ptr TCellRendererState
   TCellRendererState* = int32
@@ -718,19 +716,19 @@ type
   PCellRendererClass* = ptr TCellRendererClass
   TCellRendererClass* = object of TObjectClass
     get_size*: proc (cell: PCellRenderer, widget: PWidget, 
-                     cell_area: PGdkRectangle, x_offset: Pgint, y_offset: Pgint, 
+                     cell_area: gdk2.PRectangle, x_offset: Pgint, y_offset: Pgint, 
                      width: Pgint, height: Pgint){.cdecl.}
-    render*: proc (cell: PCellRenderer, window: PGdkWindow, widget: PWidget, 
-                   background_area: PGdkRectangle, cell_area: PGdkRectangle, 
-                   expose_area: PGdkRectangle, flags: TCellRendererState){.cdecl.}
-    activate*: proc (cell: PCellRenderer, event: PGdkEvent, widget: PWidget, 
-                     path: cstring, background_area: PGdkRectangle, 
-                     cell_area: PGdkRectangle, flags: TCellRendererState): gboolean{.
+    render*: proc (cell: PCellRenderer, window: gdk2.PWindow, widget: PWidget, 
+                   background_area: gdk2.PRectangle, cell_area: gdk2.PRectangle, 
+                   expose_area: gdk2.PRectangle, flags: TCellRendererState){.cdecl.}
+    activate*: proc (cell: PCellRenderer, event: gdk2.PEvent, widget: PWidget, 
+                     path: cstring, background_area: gdk2.PRectangle, 
+                     cell_area: gdk2.PRectangle, flags: TCellRendererState): gboolean{.
         cdecl.}
-    start_editing*: proc (cell: PCellRenderer, event: PGdkEvent, 
+    start_editing*: proc (cell: PCellRenderer, event: gdk2.PEvent, 
                           widget: PWidget, path: cstring, 
-                          background_area: PGdkRectangle, 
-                          cell_area: PGdkRectangle, flags: TCellRendererState): PCellEditable{.
+                          background_area: gdk2.PRectangle, 
+                          cell_area: gdk2.PRectangle, flags: TCellRendererState): PCellEditable{.
         cdecl.}
     reserved121: proc (){.cdecl.}
     reserved122: proc (){.cdecl.}
@@ -740,12 +738,12 @@ type
   PCellRendererText* = ptr TCellRendererText
   TCellRendererText* = object of TCellRenderer
     text*: cstring
-    font*: PPangoFontDescription
+    font*: pango.PFontDescription
     font_scale*: gdouble
-    foreground*: TPangoColor
-    background*: TPangoColor
-    extra_attrs*: PPangoAttrList
-    underline_style*: TPangoUnderline
+    foreground*: pango.TColor
+    background*: pango.TColor
+    extra_attrs*: pango.PAttrList
+    underline_style*: pango.TUnderline
     rise*: gint
     fixed_height_rows*: gint
     CellRendererText_flag0*: guint16
@@ -774,9 +772,9 @@ type
 
   PCellRendererPixbuf* = ptr TCellRendererPixbuf
   TCellRendererPixbuf* = object of TCellRenderer
-    pixbuf*: PGdkPixbuf
-    pixbuf_expander_open*: PGdkPixbuf
-    pixbuf_expander_closed*: PGdkPixbuf
+    pixbuf*: gdk2pixbuf.PPixbuf
+    pixbuf_expander_open*: gdk2pixbuf.PPixbuf
+    pixbuf_expander_closed*: gdk2pixbuf.PPixbuf
 
   PCellRendererPixbufClass* = ptr TCellRendererPixbufClass
   TCellRendererPixbufClass* = object of TCellRendererClass
@@ -800,7 +798,7 @@ type
   PMenuItem* = ptr TMenuItem
   TMenuItem* = object of TItem
     submenu*: PWidget
-    event_window*: PGdkWindow
+    event_window*: gdk2.PWindow
     toggle_size*: guint16
     accelerator_width*: guint16
     accel_path*: cstring
@@ -835,7 +833,7 @@ type
   TCheckButton* = object of TToggleButton
   PCheckButtonClass* = ptr TCheckButtonClass
   TCheckButtonClass* = object of TToggleButtonClass
-    draw_indicator*: proc (check_button: PCheckButton, area: PGdkRectangle){.
+    draw_indicator*: proc (check_button: PCheckButton, area: gdk2.PRectangle){.
         cdecl.}
     reserved181: proc (){.cdecl.}
     reserved182: proc (){.cdecl.}
@@ -849,7 +847,7 @@ type
   PCheckMenuItemClass* = ptr TCheckMenuItemClass
   TCheckMenuItemClass* = object of TMenuItemClass
     toggled*: proc (check_menu_item: PCheckMenuItem){.cdecl.}
-    draw_indicator*: proc (check_menu_item: PCheckMenuItem, area: PGdkRectangle){.
+    draw_indicator*: proc (check_menu_item: PCheckMenuItem, area: gdk2.PRectangle){.
         cdecl.}
     reserved191: proc (){.cdecl.}
     reserved192: proc (){.cdecl.}
@@ -896,16 +894,16 @@ type
     row_mem_chunk*: PGMemChunk
     cell_mem_chunk*: PGMemChunk
     freeze_count*: guint
-    internal_allocation*: TGdkRectangle
+    internal_allocation*: gdk2.TRectangle
     rows*: gint
     row_height*: gint
     row_list*: PGList
     row_list_end*: PGList
     columns*: gint
-    column_title_area*: TGdkRectangle
-    title_window*: PGdkWindow
+    column_title_area*: gdk2.TRectangle
+    title_window*: gdk2.PWindow
     column*: PCListColumn
-    clist_window*: PGdkWindow
+    clist_window*: gdk2.PWindow
     clist_window_width*: gint
     clist_window_height*: gint
     hoffset*: gint
@@ -922,10 +920,10 @@ type
     click_cell*: TCListCellInfo
     hadjustment*: PAdjustment
     vadjustment*: PAdjustment
-    xor_gc*: PGdkGC
-    fg_gc*: PGdkGC
-    bg_gc*: PGdkGC
-    cursor_drag*: PGdkCursor
+    xor_gc*: gdk2.PGC
+    fg_gc*: gdk2.PGC
+    bg_gc*: gdk2.PGC
+    cursor_drag*: gdk2.PCursor
     x_drag*: gint
     focus_row*: gint
     focus_header_column*: gint
@@ -945,10 +943,10 @@ type
     set_scroll_adjustments*: proc (clist: PCList, hadjustment: PAdjustment, 
                                    vadjustment: PAdjustment){.cdecl.}
     refresh*: proc (clist: PCList){.cdecl.}
-    select_row*: proc (clist: PCList, row: gint, column: gint, event: PGdkEvent){.
+    select_row*: proc (clist: PCList, row: gint, column: gint, event: gdk2.PEvent){.
         cdecl.}
     unselect_row*: proc (clist: PCList, row: gint, column: gint, 
-                         event: PGdkEvent){.cdecl.}
+                         event: gdk2.PEvent){.cdecl.}
     row_move*: proc (clist: PCList, source_row: gint, dest_row: gint){.cdecl.}
     click_column*: proc (clist: PCList, column: gint){.cdecl.}
     resize_column*: proc (clist: PCList, column: gint, width: gint){.cdecl.}
@@ -967,10 +965,10 @@ type
                             position: gfloat){.cdecl.}
     toggle_add_mode*: proc (clist: PCList){.cdecl.}
     abort_column_resize*: proc (clist: PCList){.cdecl.}
-    resync_selection*: proc (clist: PCList, event: PGdkEvent){.cdecl.}
+    resync_selection*: proc (clist: PCList, event: gdk2.PEvent){.cdecl.}
     selection_find*: proc (clist: PCList, row_number: gint, 
                            row_list_element: PGList): PGList{.cdecl.}
-    draw_row*: proc (clist: PCList, area: PGdkRectangle, row: gint, 
+    draw_row*: proc (clist: PCList, area: gdk2.PRectangle, row: gint, 
                      clist_row: PCListRow){.cdecl.}
     draw_drag_highlight*: proc (clist: PCList, target_row: PCListRow, 
                                 target_row_number: gint, drag_pos: TCListDragPos){.
@@ -982,8 +980,8 @@ type
     remove_row*: proc (clist: PCList, row: gint){.cdecl.}
     set_cell_contents*: proc (clist: PCList, clist_row: PCListRow, column: gint, 
                               thetype: TCellType, text: cstring, 
-                              spacing: guint8, pixmap: PGdkPixmap, 
-                              mask: PGdkBitmap){.cdecl.}
+                              spacing: guint8, pixmap: gdk2.PPixmap, 
+                              mask: gdk2.PBitmap){.cdecl.}
     cell_size_request*: proc (clist: PCList, clist_row: PCListRow, column: gint, 
                               requisition: PRequisition){.cdecl.}
 
@@ -991,9 +989,9 @@ type
   PGArray = pointer
   TCListColumn*{.final, pure.} = object 
     title*: cstring
-    area*: TGdkRectangle
+    area*: gdk2.TRectangle
     button*: PWidget
-    window*: PGdkWindow
+    window*: gdk2.PWindow
     width*: gint
     min_width*: gint
     max_width*: gint
@@ -1003,8 +1001,8 @@ type
   TCListRow*{.final, pure.} = object 
     cell*: PCell
     state*: TStateType
-    foreground*: TGdkColor
-    background*: TGdkColor
+    foreground*: gdk2.TColor
+    background*: gdk2.TColor
     style*: PStyle
     data*: gpointer
     destroy*: TDestroyNotify
@@ -1024,8 +1022,8 @@ type
     vertical*: gint16
     horizontal*: gint16
     style*: PStyle
-    pixmap*: PGdkPixmap
-    mask*: PGdkBitmap
+    pixmap*: gdk2.PPixmap
+    mask*: gdk2.PBitmap
 
   PCellPixText* = ptr TCellPixText
   TCellPixText*{.final, pure.} = object 
@@ -1035,8 +1033,8 @@ type
     style*: PStyle
     text*: cstring
     spacing*: guint8
-    pixmap*: PGdkPixmap
-    mask*: PGdkBitmap
+    pixmap*: gdk2.PPixmap
+    mask*: gdk2.PBitmap
 
   PCellWidget* = ptr TCellWidget
   TCellWidget*{.final, pure.} = object 
@@ -1053,8 +1051,8 @@ type
     style*: PStyle
     text*: cstring
     spacing*: guint8
-    pixmap*: PGdkPixmap
-    mask*: PGdkBitmap
+    pixmap*: gdk2.PPixmap
+    mask*: gdk2.PBitmap
 
   PDialogFlags* = ptr TDialogFlags
   TDialogFlags* = int32
@@ -1079,10 +1077,10 @@ type
   TVBox* = object of TBox
   PVBoxClass* = ptr TVBoxClass
   TVBoxClass* = object of TBoxClass
-  TColorSelectionChangePaletteFunc* = proc (colors: PGdkColor, n_colors: gint){.
+  TColorSelectionChangePaletteFunc* = proc (colors: gdk2.PColor, n_colors: gint){.
       cdecl.}
-  TColorSelectionChangePaletteWithScreenFunc* = proc (screen: PGdkScreen, 
-      colors: PGdkColor, n_colors: gint){.cdecl.}
+  TColorSelectionChangePaletteWithScreenFunc* = proc (screen: gdk2.PScreen, 
+      colors: gdk2.PColor, n_colors: gint){.cdecl.}
   PColorSelection* = ptr TColorSelection
   TColorSelection* = object of TVBox
     private_data*: gpointer
@@ -1157,7 +1155,7 @@ type
                                  new_parent: PCTreeNode, new_sibling: PCTreeNode): gboolean{.
       cdecl.}
   TCTree* = object of TCList
-    lines_gc*: PGdkGC
+    lines_gc*: gdk2.PGC
     tree_indent*: gint
     tree_spacing*: gint
     tree_column*: gint
@@ -1182,10 +1180,10 @@ type
     parent*: PCTreeNode
     sibling*: PCTreeNode
     children*: PCTreeNode
-    pixmap_closed*: PGdkPixmap
-    mask_closed*: PGdkBitmap
-    pixmap_opened*: PGdkPixmap
-    mask_opened*: PGdkBitmap
+    pixmap_closed*: gdk2.PPixmap
+    mask_closed*: gdk2.PBitmap
+    pixmap_opened*: gdk2.PPixmap
+    mask_opened*: gdk2.PBitmap
     level*: guint16
     CTreeRow_flag0*: guint16
 
@@ -1212,13 +1210,13 @@ type
     max_x*: gfloat
     min_y*: gfloat
     max_y*: gfloat
-    pixmap*: PGdkPixmap
+    pixmap*: gdk2.PPixmap
     curve_type*: TCurveType
     height*: gint
     grab_point*: gint
     last*: gint
     num_points*: gint
-    point*: PGdkPoint
+    point*: gdk2.PPoint
     num_ctlpoints*: gint
     ctlpoint*: Pctlpoint
 
@@ -1266,16 +1264,16 @@ type
     retrieve_surrounding*: proc (context: PIMContext): gboolean{.cdecl.}
     delete_surrounding*: proc (context: PIMContext, offset: gint, n_chars: gint): gboolean{.
         cdecl.}
-    set_client_window*: proc (context: PIMContext, window: PGdkWindow){.cdecl.}
+    set_client_window*: proc (context: PIMContext, window: gdk2.PWindow){.cdecl.}
     get_preedit_string*: proc (context: PIMContext, str: PPgchar, 
-                               attrs: var PPangoAttrList, cursor_pos: Pgint){.
+                               attrs: var pango.PAttrList, cursor_pos: Pgint){.
         cdecl.}
-    filter_keypress*: proc (context: PIMContext, event: PGdkEventKey): gboolean{.
+    filter_keypress*: proc (context: PIMContext, event: gdk2.PEventKey): gboolean{.
         cdecl.}
     focus_in*: proc (context: PIMContext){.cdecl.}
     focus_out*: proc (context: PIMContext){.cdecl.}
     reset*: proc (context: PIMContext){.cdecl.}
-    set_cursor_location*: proc (context: PIMContext, area: PGdkRectangle){.cdecl.}
+    set_cursor_location*: proc (context: PIMContext, area: gdk2.PRectangle){.cdecl.}
     set_use_preedit*: proc (context: PIMContext, use_preedit: gboolean){.cdecl.}
     set_surrounding*: proc (context: PIMContext, text: cstring, len: gint, 
                             cursor_index: gint){.cdecl.}
@@ -1331,13 +1329,13 @@ type
     tearoff_hbox*: PWidget
     tearoff_scrollbar*: PWidget
     tearoff_adjustment*: PAdjustment
-    view_window*: PGdkWindow
-    bin_window*: PGdkWindow
+    view_window*: gdk2.PWindow
+    bin_window*: gdk2.PWindow
     scroll_offset*: gint
     saved_scroll_offset*: gint
     scroll_step*: gint
     timeout_id*: guint
-    navigation_region*: PGdkRegion
+    navigation_region*: gdk2.PRegion
     navigation_timeout*: guint
     Menu_flag0*: guint16
 
@@ -1354,12 +1352,12 @@ type
     Entry_flag0*: guint16
     text_length*: guint16
     text_max_length*: guint16
-    text_area*: PGdkWindow
+    text_area*: gdk2.PWindow
     im_context*: PIMContext
     popup_menu*: PWidget
     current_pos*: gint
     selection_bound*: gint
-    cached_layout*: PPangoLayout
+    cached_layout*: pango.PLayout
     flag1*: guint16
     button*: guint
     blink_timeout*: guint
@@ -1455,10 +1453,10 @@ type
     points_button*: PWidget
     filter_button*: PWidget
     preview_entry*: PWidget
-    family*: PPangoFontFamily
-    face*: PPangoFontFace
+    family*: pango.PFontFamily
+    face*: pango.PFontFace
     size*: gint
-    font*: PGdkFont
+    font*: gdk2.PFont
 
   PFontSelectionClass* = ptr TFontSelectionClass
   TFontSelectionClass* = object of TVBoxClass
@@ -1503,8 +1501,8 @@ type
 
   PHandleBox* = ptr THandleBox
   THandleBox* = object of TBin
-    bin_window*: PGdkWindow
-    float_window*: PGdkWindow
+    bin_window*: gdk2.PWindow
+    float_window*: gdk2.PWindow
     shadow_type*: TShadowType
     HandleBox_flag0*: guint16
     deskoff_x*: gint
@@ -1525,10 +1523,10 @@ type
   TPaned* = object of TContainer
     child1*: PWidget
     child2*: PWidget
-    handle*: PGdkWindow
-    xor_gc*: PGdkGC
-    cursor_type*: TGdkCursorType
-    handle_pos*: TGdkRectangle
+    handle*: gdk2.PWindow
+    xor_gc*: gdk2.PGC
+    cursor_type*: gdk2.TCursorType
+    handle_pos*: gdk2.TRectangle
     child1_size*: gint
     last_allocation*: gint
     min_position*: gint
@@ -1565,8 +1563,8 @@ type
   PRulerMetric* = ptr TRulerMetric
   PRuler* = ptr TRuler
   TRuler* = object of TWidget
-    backing_store*: PGdkPixmap
-    non_gr_exp_gc*: PGdkGC
+    backing_store*: gdk2.PPixmap
+    non_gr_exp_gc*: gdk2.PGC
     metric*: PRulerMetric
     xsrc*: gint
     ysrc*: gint
@@ -1602,7 +1600,7 @@ type
     queued_settings*: PGData
     property_values*: PGValue
     rc_context*: PRcContext
-    screen*: PGdkScreen
+    screen*: gdk2.PScreen
 
   PSettingsClass* = ptr TSettingsClass
   TSettingsClass* = object of TGObjectClass
@@ -1617,12 +1615,12 @@ type
   TRcStyle* = object of TGObject
     name*: cstring
     bg_pixmap_name*: array[0..4, cstring]
-    font_desc*: PPangoFontDescription
+    font_desc*: pango.PFontDescription
     color_flags*: array[0..4, TRcFlags]
-    fg*: array[0..4, TGdkColor]
-    bg*: array[0..4, TGdkColor]
-    text*: array[0..4, TGdkColor]
-    base*: array[0..4, TGdkColor]
+    fg*: array[0..4, gdk2.TColor]
+    bg*: array[0..4, gdk2.TColor]
+    text*: array[0..4, gdk2.TColor]
+    base*: array[0..4, gdk2.TColor]
     xthickness*: gint
     ythickness*: gint
     rc_properties*: PGArray
@@ -1665,35 +1663,35 @@ type
   TRcPropertyParser* = proc (pspec: PGParamSpec, rc_string: PGString, 
                              property_value: PGValue): gboolean{.cdecl.}
   TStyle* = object of TGObject
-    fg*: array[0..4, TGdkColor]
-    bg*: array[0..4, TGdkColor]
-    light*: array[0..4, TGdkColor]
-    dark*: array[0..4, TGdkColor]
-    mid*: array[0..4, TGdkColor]
-    text*: array[0..4, TGdkColor]
-    base*: array[0..4, TGdkColor]
-    text_aa*: array[0..4, TGdkColor]
-    black*: TGdkColor
-    white*: TGdkColor
-    font_desc*: PPangoFontDescription
+    fg*: array[0..4, gdk2.TColor]
+    bg*: array[0..4, gdk2.TColor]
+    light*: array[0..4, gdk2.TColor]
+    dark*: array[0..4, gdk2.TColor]
+    mid*: array[0..4, gdk2.TColor]
+    text*: array[0..4, gdk2.TColor]
+    base*: array[0..4, gdk2.TColor]
+    text_aa*: array[0..4, gdk2.TColor]
+    black*: gdk2.TColor
+    white*: gdk2.TColor
+    font_desc*: pango.PFontDescription
     xthickness*: gint
     ythickness*: gint
-    fg_gc*: array[0..4, PGdkGC]
-    bg_gc*: array[0..4, PGdkGC]
-    light_gc*: array[0..4, PGdkGC]
-    dark_gc*: array[0..4, PGdkGC]
-    mid_gc*: array[0..4, PGdkGC]
-    text_gc*: array[0..4, PGdkGC]
-    base_gc*: array[0..4, PGdkGC]
-    text_aa_gc*: array[0..4, PGdkGC]
-    black_gc*: PGdkGC
-    white_gc*: PGdkGC
-    bg_pixmap*: array[0..4, PGdkPixmap]
+    fg_gc*: array[0..4, gdk2.PGC]
+    bg_gc*: array[0..4, gdk2.PGC]
+    light_gc*: array[0..4, gdk2.PGC]
+    dark_gc*: array[0..4, gdk2.PGC]
+    mid_gc*: array[0..4, gdk2.PGC]
+    text_gc*: array[0..4, gdk2.PGC]
+    base_gc*: array[0..4, gdk2.PGC]
+    text_aa_gc*: array[0..4, gdk2.PGC]
+    black_gc*: gdk2.PGC
+    white_gc*: gdk2.PGC
+    bg_pixmap*: array[0..4, gdk2.PPixmap]
     attach_count*: gint
     depth*: gint
-    colormap*: PGdkColormap
-    private_font*: PGdkFont
-    private_font_desc*: PPangoFontDescription
+    colormap*: gdk2.PColormap
+    private_font*: gdk2.PFont
+    private_font_desc*: pango.PFontDescription
     rc_style*: PRcStyle
     styles*: PGSList
     property_cache*: PGArray
@@ -1706,104 +1704,104 @@ type
     copy*: proc (style: PStyle, src: PStyle){.cdecl.}
     clone*: proc (style: PStyle): PStyle{.cdecl.}
     init_from_rc*: proc (style: PStyle, rc_style: PRcStyle){.cdecl.}
-    set_background*: proc (style: PStyle, window: PGdkWindow, 
+    set_background*: proc (style: PStyle, window: gdk2.PWindow, 
                            state_type: TStateType){.cdecl.}
     render_icon*: proc (style: PStyle, source: PIconSource, 
                         direction: TTextDirection, state: TStateType, 
-                        size: TIconSize, widget: PWidget, detail: cstring): PGdkPixbuf{.
+                        size: TIconSize, widget: PWidget, detail: cstring): gdk2pixbuf.PPixbuf{.
         cdecl.}
-    draw_hline*: proc (style: PStyle, window: PGdkWindow, 
-                       state_type: TStateType, area: PGdkRectangle, 
+    draw_hline*: proc (style: PStyle, window: gdk2.PWindow, 
+                       state_type: TStateType, area: gdk2.PRectangle, 
                        widget: PWidget, detail: cstring, x1: gint, x2: gint, 
                        y: gint){.cdecl.}
-    draw_vline*: proc (style: PStyle, window: PGdkWindow, 
-                       state_type: TStateType, area: PGdkRectangle, 
+    draw_vline*: proc (style: PStyle, window: gdk2.PWindow, 
+                       state_type: TStateType, area: gdk2.PRectangle, 
                        widget: PWidget, detail: cstring, y1: gint, y2: gint, 
                        x: gint){.cdecl.}
-    draw_shadow*: proc (style: PStyle, window: PGdkWindow, 
+    draw_shadow*: proc (style: PStyle, window: gdk2.PWindow, 
                         state_type: TStateType, shadow_type: TShadowType, 
-                        area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                        area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                         x: gint, y: gint, width: gint, height: gint){.cdecl.}
-    draw_polygon*: proc (style: PStyle, window: PGdkWindow, 
+    draw_polygon*: proc (style: PStyle, window: gdk2.PWindow, 
                          state_type: TStateType, shadow_type: TShadowType, 
-                         area: PGdkRectangle, widget: PWidget, detail: cstring, 
-                         point: PGdkPoint, npoints: gint, fill: gboolean){.cdecl.}
-    draw_arrow*: proc (style: PStyle, window: PGdkWindow, 
+                         area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
+                         point: gdk2.PPoint, npoints: gint, fill: gboolean){.cdecl.}
+    draw_arrow*: proc (style: PStyle, window: gdk2.PWindow, 
                        state_type: TStateType, shadow_type: TShadowType, 
-                       area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                       area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                        arrow_type: TArrowType, fill: gboolean, x: gint, y: gint, 
                        width: gint, height: gint){.cdecl.}
-    draw_diamond*: proc (style: PStyle, window: PGdkWindow, 
+    draw_diamond*: proc (style: PStyle, window: gdk2.PWindow, 
                          state_type: TStateType, shadow_type: TShadowType, 
-                         area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                         area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                          x: gint, y: gint, width: gint, height: gint){.cdecl.}
-    draw_string*: proc (style: PStyle, window: PGdkWindow, 
-                        state_type: TStateType, area: PGdkRectangle, 
+    draw_string*: proc (style: PStyle, window: gdk2.PWindow, 
+                        state_type: TStateType, area: gdk2.PRectangle, 
                         widget: PWidget, detail: cstring, x: gint, y: gint, 
                         `string`: cstring){.cdecl.}
-    draw_box*: proc (style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                     shadow_type: TShadowType, area: PGdkRectangle, 
+    draw_box*: proc (style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                     shadow_type: TShadowType, area: gdk2.PRectangle, 
                      widget: PWidget, detail: cstring, x: gint, y: gint, 
                      width: gint, height: gint){.cdecl.}
-    draw_flat_box*: proc (style: PStyle, window: PGdkWindow, 
+    draw_flat_box*: proc (style: PStyle, window: gdk2.PWindow, 
                           state_type: TStateType, shadow_type: TShadowType, 
-                          area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                          area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                           x: gint, y: gint, width: gint, height: gint){.cdecl.}
-    draw_check*: proc (style: PStyle, window: PGdkWindow, 
+    draw_check*: proc (style: PStyle, window: gdk2.PWindow, 
                        state_type: TStateType, shadow_type: TShadowType, 
-                       area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                       area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                        x: gint, y: gint, width: gint, height: gint){.cdecl.}
-    draw_option*: proc (style: PStyle, window: PGdkWindow, 
+    draw_option*: proc (style: PStyle, window: gdk2.PWindow, 
                         state_type: TStateType, shadow_type: TShadowType, 
-                        area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                        area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                         x: gint, y: gint, width: gint, height: gint){.cdecl.}
-    draw_tab*: proc (style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                     shadow_type: TShadowType, area: PGdkRectangle, 
+    draw_tab*: proc (style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                     shadow_type: TShadowType, area: gdk2.PRectangle, 
                      widget: PWidget, detail: cstring, x: gint, y: gint, 
                      width: gint, height: gint){.cdecl.}
-    draw_shadow_gap*: proc (style: PStyle, window: PGdkWindow, 
+    draw_shadow_gap*: proc (style: PStyle, window: gdk2.PWindow, 
                             state_type: TStateType, shadow_type: TShadowType, 
-                            area: PGdkRectangle, widget: PWidget, 
+                            area: gdk2.PRectangle, widget: PWidget, 
                             detail: cstring, x: gint, y: gint, width: gint, 
                             height: gint, gap_side: TPositionType, gap_x: gint, 
                             gap_width: gint){.cdecl.}
-    draw_box_gap*: proc (style: PStyle, window: PGdkWindow, 
+    draw_box_gap*: proc (style: PStyle, window: gdk2.PWindow, 
                          state_type: TStateType, shadow_type: TShadowType, 
-                         area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                         area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                          x: gint, y: gint, width: gint, height: gint, 
                          gap_side: TPositionType, gap_x: gint, gap_width: gint){.
         cdecl.}
-    draw_extension*: proc (style: PStyle, window: PGdkWindow, 
+    draw_extension*: proc (style: PStyle, window: gdk2.PWindow, 
                            state_type: TStateType, shadow_type: TShadowType, 
-                           area: PGdkRectangle, widget: PWidget, 
+                           area: gdk2.PRectangle, widget: PWidget, 
                            detail: cstring, x: gint, y: gint, width: gint, 
                            height: gint, gap_side: TPositionType){.cdecl.}
-    draw_focus*: proc (style: PStyle, window: PGdkWindow, 
-                       state_type: TStateType, area: PGdkRectangle, 
+    draw_focus*: proc (style: PStyle, window: gdk2.PWindow, 
+                       state_type: TStateType, area: gdk2.PRectangle, 
                        widget: PWidget, detail: cstring, x: gint, y: gint, 
                        width: gint, height: gint){.cdecl.}
-    draw_slider*: proc (style: PStyle, window: PGdkWindow, 
+    draw_slider*: proc (style: PStyle, window: gdk2.PWindow, 
                         state_type: TStateType, shadow_type: TShadowType, 
-                        area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                        area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                         x: gint, y: gint, width: gint, height: gint, 
                         orientation: TOrientation){.cdecl.}
-    draw_handle*: proc (style: PStyle, window: PGdkWindow, 
+    draw_handle*: proc (style: PStyle, window: gdk2.PWindow, 
                         state_type: TStateType, shadow_type: TShadowType, 
-                        area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                        area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                         x: gint, y: gint, width: gint, height: gint, 
                         orientation: TOrientation){.cdecl.}
-    draw_expander*: proc (style: PStyle, window: PGdkWindow, 
-                          state_type: TStateType, area: PGdkRectangle, 
+    draw_expander*: proc (style: PStyle, window: gdk2.PWindow, 
+                          state_type: TStateType, area: gdk2.PRectangle, 
                           widget: PWidget, detail: cstring, x: gint, y: gint, 
                           expander_style: TExpanderStyle){.cdecl.}
-    draw_layout*: proc (style: PStyle, window: PGdkWindow, 
+    draw_layout*: proc (style: PStyle, window: gdk2.PWindow, 
                         state_type: TStateType, use_text: gboolean, 
-                        area: PGdkRectangle, widget: PWidget, detail: cstring, 
-                        x: gint, y: gint, layout: PPangoLayout){.cdecl.}
-    draw_resize_grip*: proc (style: PStyle, window: PGdkWindow, 
-                             state_type: TStateType, area: PGdkRectangle, 
+                        area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
+                        x: gint, y: gint, layout: pango.PLayout){.cdecl.}
+    draw_resize_grip*: proc (style: PStyle, window: gdk2.PWindow, 
+                             state_type: TStateType, area: gdk2.PRectangle, 
                              widget: PWidget, detail: cstring, 
-                             edge: TGdkWindowEdge, x: gint, y: gint, 
+                             edge: gdk2.TWindowEdge, x: gint, y: gint, 
                              width: gint, height: gint){.cdecl.}
     reserved381: proc (){.cdecl.}
     reserved382: proc (){.cdecl.}
@@ -1834,7 +1832,7 @@ type
     Range_flag0*: guint16
     min_slider_size*: gint
     orientation*: TOrientation
-    range_rect*: TGdkRectangle
+    range_rect*: gdk2.TRectangle
     slider_start*: gint
     slider_end*: gint
     round_digits*: gint
@@ -1844,7 +1842,7 @@ type
     slide_initial_slider_position*: gint
     slide_initial_coordinate*: gint
     update_timeout_id*: guint
-    event_window*: PGdkWindow
+    event_window*: gdk2.PWindow
 
   PRangeClass* = ptr TRangeClass
   TRangeClass* = object of TWidgetClass
@@ -1912,15 +1910,15 @@ type
   PIconSet* = pointer
   PImagePixmapData* = ptr TImagePixmapData
   TImagePixmapData*{.final, pure.} = object 
-    pixmap*: PGdkPixmap
+    pixmap*: gdk2.PPixmap
 
   PImageImageData* = ptr TImageImageData
   TImageImageData*{.final, pure.} = object 
-    image*: PGdkImage
+    image*: gdk2.PImage
 
   PImagePixbufData* = ptr TImagePixbufData
   TImagePixbufData*{.final, pure.} = object 
-    pixbuf*: PGdkPixbuf
+    pixbuf*: gdk2pixbuf.PPixbuf
 
   PImageStockData* = ptr TImageStockData
   TImageStockData*{.final, pure.} = object 
@@ -1932,8 +1930,8 @@ type
 
   PImageAnimationData* = ptr TImageAnimationData
   TImageAnimationData*{.final, pure.} = object 
-    anim*: PGdkPixbufAnimation
-    iter*: PGdkPixbufAnimationIter
+    anim*: gdk2pixbuf.PPixbufAnimation
+    iter*: gdk2pixbuf.PPixbufAnimationIter
     frame_timeout*: guint
 
   PImageType* = ptr TImageType
@@ -1944,7 +1942,7 @@ type
   TImage* = object of TMisc
     storage_type*: TImageType
     pixmap*: TImagePixmapData
-    mask*: PGdkBitmap
+    mask*: gdk2.PBitmap
     icon_size*: TIconSize
 
   PImageClass* = ptr TImageClass
@@ -1973,7 +1971,7 @@ type
   PIMMulticontext* = ptr TIMMulticontext
   TIMMulticontext* = object of TIMContext
     slave*: PIMContext
-    client_window*: PGdkWindow
+    client_window*: gdk2.PWindow
     context_id*: cstring
 
   PIMMulticontextClass* = ptr TIMMulticontextClass
@@ -1990,15 +1988,15 @@ type
     mode_optionmenu*: PWidget
     close_button*: PWidget
     save_button*: PWidget
-    axis_items*: array[0..(GDK_AXIS_LAST) - 1, PWidget]
-    current_device*: PGdkDevice
+    axis_items*: array[0..(gdk2.AXIS_LAST) - 1, PWidget]
+    current_device*: gdk2.PDevice
     keys_list*: PWidget
     keys_listbox*: PWidget
 
   PInputDialogClass* = ptr TInputDialogClass
   TInputDialogClass* = object of TDialogClass
-    enable_device*: proc (inputd: PInputDialog, device: PGdkDevice){.cdecl.}
-    disable_device*: proc (inputd: PInputDialog, device: PGdkDevice){.cdecl.}
+    enable_device*: proc (inputd: PInputDialog, device: gdk2.PDevice){.cdecl.}
+    disable_device*: proc (inputd: PInputDialog, device: gdk2.PDevice){.cdecl.}
     reserved461: proc (){.cdecl.}
     reserved462: proc (){.cdecl.}
     reserved463: proc (){.cdecl.}
@@ -2007,7 +2005,7 @@ type
   PInvisible* = ptr TInvisible
   TInvisible* = object of TWidget
     has_user_ref_count*: gboolean
-    screen*: PGdkScreen
+    screen*: gdk2.PScreen
 
   PInvisibleClass* = ptr TInvisibleClass
   TInvisibleClass* = object of TWidgetClass
@@ -2061,8 +2059,8 @@ type
     height*: guint
     hadjustment*: PAdjustment
     vadjustment*: PAdjustment
-    bin_window*: PGdkWindow
-    visibility*: TGdkVisibilityState
+    bin_window*: gdk2.PWindow
+    visibility*: gdk2.TVisibilityState
     scroll_x*: gint
     scroll_y*: gint
     freeze_count*: guint
@@ -2209,7 +2207,7 @@ type
     reserved504: proc (){.cdecl.}
 
   TModuleInitFunc* = proc (argc: Pgint, argv: PPPgchar){.cdecl.}
-  TKeySnoopFunc* = proc (grab_widget: PWidget, event: PGdkEventKey, 
+  TKeySnoopFunc* = proc (grab_widget: PWidget, event: gdk2.PEventKey, 
                          func_data: gpointer): gint{.cdecl.}
   PMenuBar* = ptr TMenuBar
   TMenuBar* = object of TMenuShell
@@ -2250,7 +2248,7 @@ type
     first_tab*: PGList
     focus_tab*: PGList
     menu*: PWidget
-    event_window*: PGdkWindow
+    event_window*: gdk2.PWindow
     timer*: guint32
     tab_hborder*: guint16
     tab_vborder*: guint16
@@ -2321,16 +2319,16 @@ type
 
   PPixmap* = ptr TPixmap
   TPixmap* = object of TMisc
-    pixmap*: PGdkPixmap
-    mask*: PGdkBitmap
-    pixmap_insensitive*: PGdkPixmap
+    pixmap*: gdk2.PPixmap
+    mask*: gdk2.PBitmap
+    pixmap_insensitive*: gdk2.PPixmap
     Pixmap_flag0*: guint16
 
   PPixmapClass* = ptr TPixmapClass
   TPixmapClass* = object of TMiscClass
   PPlug* = ptr TPlug
   TPlug* = object of TWindow
-    socket_window*: PGdkWindow
+    socket_window*: gdk2.PWindow
     modality_window*: PWidget
     modality_group*: PWindowGroup
     grabbed_keys*: PGHashTable
@@ -2351,7 +2349,7 @@ type
     buffer_height*: guint16
     bpp*: guint16
     rowstride*: guint16
-    dither*: TGdkRgbDither
+    dither*: gdk2.TRgbDither
     Preview_flag0*: guint16
 
   PPreviewInfo* = ptr TPreviewInfo
@@ -2370,7 +2368,7 @@ type
   PProgress* = ptr TProgress
   TProgress* = object of TWidget
     adjustment*: PAdjustment
-    offscreen_pixmap*: PGdkPixmap
+    offscreen_pixmap*: gdk2.PPixmap
     format*: cstring
     x_align*: gfloat
     y_align*: gfloat
@@ -2454,13 +2452,13 @@ type
     reserved604: proc (){.cdecl.}
 
   TSelectionData*{.final, pure.} = object 
-    selection*: TGdkAtom
-    target*: TGdkAtom
-    thetype*: TGdkAtom
+    selection*: gdk2.TAtom
+    target*: gdk2.TAtom
+    thetype*: gdk2.TAtom
     format*: gint
     data*: Pguchar
     length*: gint
-    display*: PGdkDisplay
+    display*: gdk2.PDisplay
 
   PTargetEntry* = ptr TTargetEntry
   TTargetEntry*{.final, pure.} = object 
@@ -2475,7 +2473,7 @@ type
 
   PTargetPair* = ptr TTargetPair
   TTargetPair*{.final, pure.} = object 
-    target*: TGdkAtom
+    target*: gdk2.TAtom
     flags*: guint
     info*: guint
 
@@ -2506,7 +2504,7 @@ type
     request_height*: guint16
     current_width*: guint16
     current_height*: guint16
-    plug_window*: PGdkWindow
+    plug_window*: gdk2.PWindow
     plug_widget*: PWidget
     xembed_version*: gshort
     Socket_flag0*: guint16
@@ -2532,7 +2530,7 @@ type
   PSpinButton* = ptr TSpinButton
   TSpinButton* = object of TEntry
     adjustment*: PAdjustment
-    panel*: PGdkWindow
+    panel*: gdk2.PWindow
     timer*: guint32
     climb_rate*: gdouble
     timer_step*: gdouble
@@ -2554,7 +2552,7 @@ type
   TStockItem*{.final, pure.} = object 
     stock_id*: cstring
     label*: cstring
-    modifier*: TGdkModifierType
+    modifier*: gdk2.TModifierType
     keyval*: guint
     translation_domain*: cstring
 
@@ -2566,7 +2564,7 @@ type
     keys*: PGSList
     seq_context_id*: guint
     seq_message_id*: guint
-    grip_window*: PGdkWindow
+    grip_window*: gdk2.PWindow
     Statusbar_flag0*: guint16
 
   PStatusbarClass* = ptr TStatusbarClass
@@ -2632,12 +2630,12 @@ type
 
   PText* = ptr TText
   TText* = object of TOldEditable
-    text_area*: PGdkWindow
+    text_area*: gdk2.PWindow
     hadj*: PAdjustment
     vadj*: PAdjustment
-    gc*: PGdkGC
-    line_wrap_bitmap*: PGdkPixmap
-    line_arrow_bitmap*: PGdkPixmap
+    gc*: gdk2.PGC
+    line_wrap_bitmap*: gdk2.PPixmap
+    line_arrow_bitmap*: gdk2.PPixmap
     text*: Pguchar
     text_len*: guint
     gap_position*: guint
@@ -2659,7 +2657,7 @@ type
     cursor_pos_x*: gint
     cursor_pos_y*: gint
     cursor_mark*: TPropertyMark
-    cursor_char*: TGdkWChar
+    cursor_char*: gdk2.TWChar
     cursor_char_offset*: gchar
     cursor_virtual_x*: gint
     cursor_drawn_level*: gint
@@ -2669,7 +2667,7 @@ type
     current_font*: PTextFont
     timer*: gint
     button*: guint
-    bg_gc*: PGdkGC
+    bg_gc*: gdk2.PGC
 
   PTextClass* = ptr TTextClass
   TTextClass* = object of TOldEditableClass
@@ -2709,7 +2707,7 @@ type
     TextTag_flag0*: int32
 
   TTextTagClass* = object of TGObjectClass
-    event*: proc (tag: PTextTag, event_object: PGObject, event: PGdkEvent, 
+    event*: proc (tag: PTextTag, event_object: PGObject, event: gdk2.PEvent, 
                   iter: PTextIter): gboolean{.cdecl.}
     reserved661: proc (){.cdecl.}
     reserved662: proc (){.cdecl.}
@@ -2718,10 +2716,10 @@ type
 
   PTextAppearance* = ptr TTextAppearance
   TTextAppearance*{.final, pure.} = object 
-    bg_color*: TGdkColor
-    fg_color*: TGdkColor
-    bg_stipple*: PGdkBitmap
-    fg_stipple*: PGdkBitmap
+    bg_color*: gdk2.TColor
+    fg_color*: gdk2.TColor
+    bg_stipple*: gdk2.PBitmap
+    fg_stipple*: gdk2.PBitmap
     rise*: gint
     padding1*: gpointer
     flag0*: guint16
@@ -2731,7 +2729,7 @@ type
     appearance*: TTextAppearance
     justification*: TJustification
     direction*: TTextDirection
-    font*: PPangoFontDescription
+    font*: pango.PFontDescription
     font_scale*: gdouble
     left_margin*: gint
     indent*: gint
@@ -2739,9 +2737,9 @@ type
     pixels_above_lines*: gint
     pixels_below_lines*: gint
     pixels_inside_wrap*: gint
-    tabs*: PPangoTabArray
+    tabs*: pango.PTabArray
     wrap_mode*: TWrapMode
-    language*: PPangoLanguage
+    language*: pango.PLanguage
     padding1*: gpointer
     flag0*: guint16
 
@@ -2795,7 +2793,7 @@ type
 
   PTextPixbuf* = ptr TTextPixbuf
   TTextPixbuf*{.final, pure.} = object 
-    pixbuf*: PGdkPixbuf
+    pixbuf*: gdk2pixbuf.PPixbuf
 
   PTextChildBody* = ptr TTextChildBody
   TTextChildBody*{.final, pure.} = object 
@@ -2870,7 +2868,7 @@ type
     insert_text*: proc (buffer: PTextBuffer, pos: PTextIter, text: cstring, 
                         length: gint){.cdecl.}
     insert_pixbuf*: proc (buffer: PTextBuffer, pos: PTextIter, 
-                          pixbuf: PGdkPixbuf){.cdecl.}
+                          pixbuf: gdk2pixbuf.PPixbuf){.cdecl.}
     insert_child_anchor*: proc (buffer: PTextBuffer, pos: PTextIter, 
                                 anchor: PTextChildAnchor){.cdecl.}
     delete_range*: proc (buffer: PTextBuffer, start: PTextIter, 
@@ -2901,14 +2899,14 @@ type
     height*: gint
     buffer*: PTextBuffer
     default_style*: PTextAttributes
-    ltr_context*: PPangoContext
-    rtl_context*: PPangoContext
+    ltr_context*: pango.PContext
+    rtl_context*: pango.PContext
     one_style_cache*: PTextAttributes
     one_display_cache*: PTextLineDisplay
     wrap_loop_count*: gint
     TextLayout_flag0*: guint16
     preedit_string*: cstring
-    preedit_attrs*: PPangoAttrList
+    preedit_attrs*: pango.PAttrList
     preedit_len*: gint
     preedit_cursor*: gint
 
@@ -2920,7 +2918,7 @@ type
     wrap*: proc (layout: PTextLayout, line: PTextLine, line_data: PTextLineData): PTextLineData{.
         cdecl.}
     get_log_attrs*: proc (layout: PTextLayout, line: PTextLine, 
-                          attrs: var PPangoLogAttr, n_attrs: Pgint){.cdecl.}
+                          attrs: var pango.PLogAttr, n_attrs: Pgint){.cdecl.}
     invalidate*: proc (layout: PTextLayout, start: PTextIter, theEnd: PTextIter){.
         cdecl.}
     free_line_data*: proc (layout: PTextLayout, line: PTextLine, 
@@ -2934,7 +2932,7 @@ type
 
   PTextAttrAppearance* = ptr TTextAttrAppearance
   TTextAttrAppearance*{.final, pure.} = object 
-    attr*: TPangoAttribute
+    attr*: pango.TAttribute
     appearance*: TTextAppearance
 
   PTextCursorDisplay* = ptr TTextCursorDisplay
@@ -2945,7 +2943,7 @@ type
     flag0*: guint16
 
   TTextLineDisplay*{.final, pure.} = object 
-    layout*: PPangoLayout
+    layout*: pango.PLayout
     cursors*: PGSList
     shaped_objects*: PGSList
     direction*: TTextDirection
@@ -2981,7 +2979,7 @@ type
     left_margin*: gint
     right_margin*: gint
     indent*: gint
-    tabs*: PPangoTabArray
+    tabs*: pango.PTabArray
     TextView_flag0*: guint16
     text_window*: PTextWindow
     left_window*: PTextWindow
@@ -3045,7 +3043,7 @@ type
     label_no_tip*: cstring
     caller*: PWidget
     last_crossed*: PWidget
-    query_cursor*: PGdkCursor
+    query_cursor*: gdk2.PCursor
 
   PTipsQueryClass* = ptr TTipsQueryClass
   TTipsQueryClass* = object of TLabelClass
@@ -3055,7 +3053,7 @@ type
                            tip_text: cstring, tip_private: cstring){.cdecl.}
     widget_selected*: proc (tips_query: PTipsQuery, widget: PWidget, 
                             tip_text: cstring, tip_private: cstring, 
-                            event: PGdkEventButton): gint{.cdecl.}
+                            event: gdk2.PEventButton): gint{.cdecl.}
     reserved721: proc (){.cdecl.}
     reserved722: proc (){.cdecl.}
     reserved723: proc (){.cdecl.}
@@ -3233,7 +3231,7 @@ type
     child*: PWidget
     arrow*: PWidget
     alignment*: PWidget
-    window*: PGdkWindow
+    window*: gdk2.PWindow
     editable_widget*: PCellEditable
     xalign*: gfloat
     property_changed_signal*: guint
@@ -3310,10 +3308,10 @@ type
     expander_size*: gint
     hadjustment*: PAdjustment
     vadjustment*: PAdjustment
-    bin_window*: PGdkWindow
-    header_window*: PGdkWindow
-    drag_window*: PGdkWindow
-    drag_highlight_window*: PGdkWindow
+    bin_window*: gdk2.PWindow
+    header_window*: gdk2.PWindow
+    drag_window*: gdk2.PWindow
+    drag_highlight_window*: gdk2.PWindow
     drag_column*: PTreeViewColumn
     last_button_press*: PTreeRowReference
     last_button_press_2*: PTreeRowReference
@@ -3411,8 +3409,8 @@ type
   PViewport* = ptr TViewport
   TViewport* = object of TBin
     shadow_type*: TShadowType
-    view_window*: PGdkWindow
-    bin_window*: PGdkWindow
+    view_window*: gdk2.PWindow
+    bin_window*: gdk2.PWindow
     hadjustment*: PAdjustment
     vadjustment*: PAdjustment
 
@@ -3455,7 +3453,7 @@ const
   ARG_CHILD_ARG* = 1 shl 4
 
 proc TYPE_OBJECT*(): GType
-proc OBJECT*(anObject: pointer): PObject
+proc `OBJECT`*(anObject: pointer): PObject
 proc OBJECT_CLASS*(klass: pointer): PObjectClass
 proc IS_OBJECT*(anObject: pointer): bool
 proc IS_OBJECT_CLASS*(klass: pointer): bool
@@ -3501,13 +3499,13 @@ proc type_class*(thetype: TType): gpointer{.cdecl, dynlib: lib,
 const 
   TOPLEVEL* = 1 shl 4
   NO_WINDOW* = 1 shl 5
-  REALIZED* = 1 shl 6
+  constREALIZED* = 1 shl 6
   MAPPED* = 1 shl 7
-  VISIBLE* = 1 shl 8
+  constVISIBLE* = 1 shl 8
   SENSITIVE* = 1 shl 9
   PARENT_SENSITIVE* = 1 shl 10
   CAN_FOCUS* = 1 shl 11
-  HAS_FOCUS* = 1 shl 12
+  constHAS_FOCUS* = 1 shl 12
   CAN_DEFAULT* = 1 shl 13
   HAS_DEFAULT* = 1 shl 14
   HAS_GRAB* = 1 shl 15
@@ -3604,11 +3602,11 @@ proc widget_get_child_requisition*(widget: PWidget, requisition: PRequisition){.
     cdecl, dynlib: lib, importc: "gtk_widget_get_child_requisition".}
 proc widget_add_accelerator*(widget: PWidget, accel_signal: cstring, 
                              accel_group: PAccelGroup, accel_key: guint, 
-                             accel_mods: TGdkModifierType, 
+                             accel_mods: gdk2.TModifierType, 
                              accel_flags: TAccelFlags){.cdecl, dynlib: lib, 
     importc: "gtk_widget_add_accelerator".}
 proc widget_remove_accelerator*(widget: PWidget, accel_group: PAccelGroup, 
-                                accel_key: guint, accel_mods: TGdkModifierType): gboolean{.
+                                accel_key: guint, accel_mods: gdk2.TModifierType): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_widget_remove_accelerator".}
 proc widget_set_accel_path*(widget: PWidget, accel_path: cstring, 
                             accel_group: PAccelGroup){.cdecl, dynlib: lib, 
@@ -3619,9 +3617,9 @@ proc widget_list_accel_closures*(widget: PWidget): PGList{.cdecl, dynlib: lib,
     importc: "gtk_widget_list_accel_closures".}
 proc widget_mnemonic_activate*(widget: PWidget, group_cycling: gboolean): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_widget_mnemonic_activate".}
-proc widget_event*(widget: PWidget, event: PGdkEvent): gboolean{.cdecl, 
+proc widget_event*(widget: PWidget, event: gdk2.PEvent): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_widget_event".}
-proc widget_send_expose*(widget: PWidget, event: PGdkEvent): gint{.cdecl, 
+proc widget_send_expose*(widget: PWidget, event: gdk2.PEvent): gint{.cdecl, 
     dynlib: lib, importc: "gtk_widget_send_expose".}
 proc widget_activate*(widget: PWidget): gboolean{.cdecl, dynlib: lib, 
     importc: "gtk_widget_activate".}
@@ -3630,10 +3628,10 @@ proc widget_set_scroll_adjustments*(widget: PWidget, hadjustment: PAdjustment,
     dynlib: lib, importc: "gtk_widget_set_scroll_adjustments".}
 proc widget_reparent*(widget: PWidget, new_parent: PWidget){.cdecl, dynlib: lib, 
     importc: "gtk_widget_reparent".}
-proc widget_intersect*(widget: PWidget, area: PGdkRectangle, 
-                       intersection: PGdkRectangle): gboolean{.cdecl, 
+proc widget_intersect*(widget: PWidget, area: gdk2.PRectangle, 
+                       intersection: gdk2.PRectangle): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_widget_intersect".}
-proc widget_region_intersect*(widget: PWidget, region: PGdkRegion): PGdkRegion{.
+proc widget_region_intersect*(widget: PWidget, region: gdk2.PRegion): gdk2.PRegion{.
     cdecl, dynlib: lib, importc: "gtk_widget_region_intersect".}
 proc widget_freeze_child_notify*(widget: PWidget){.cdecl, dynlib: lib, 
     importc: "gtk_widget_freeze_child_notify".}
@@ -3664,7 +3662,7 @@ proc widget_set_redraw_on_allocate*(widget: PWidget,
     dynlib: lib, importc: "gtk_widget_set_redraw_on_allocate".}
 proc widget_set_parent*(widget: PWidget, parent: PWidget){.cdecl, dynlib: lib, 
     importc: "gtk_widget_set_parent".}
-proc widget_set_parent_window*(widget: PWidget, parent_window: PGdkWindow){.
+proc widget_set_parent_window*(widget: PWidget, parent_window: gdk2.PWindow){.
     cdecl, dynlib: lib, importc: "gtk_widget_set_parent_window".}
 proc widget_set_child_visible*(widget: PWidget, is_visible: gboolean){.cdecl, 
     dynlib: lib, importc: "gtk_widget_set_child_visible".}
@@ -3672,7 +3670,7 @@ proc widget_get_child_visible*(widget: PWidget): gboolean{.cdecl, dynlib: lib,
     importc: "gtk_widget_get_child_visible".}
 proc widget_get_parent*(widget: PWidget): PWidget{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_parent".}
-proc widget_get_parent_window*(widget: PWidget): PGdkWindow{.cdecl, dynlib: lib, 
+proc widget_get_parent_window*(widget: PWidget): gdk2.PWindow{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_parent_window".}
 proc widget_child_focus*(widget: PWidget, direction: TDirectionType): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_widget_child_focus".}
@@ -3684,33 +3682,33 @@ proc widget_set_events*(widget: PWidget, events: gint){.cdecl, dynlib: lib,
     importc: "gtk_widget_set_events".}
 proc widget_add_events*(widget: PWidget, events: gint){.cdecl, dynlib: lib, 
     importc: "gtk_widget_add_events".}
-proc widget_set_extension_events*(widget: PWidget, mode: TGdkExtensionMode){.
+proc widget_set_extension_events*(widget: PWidget, mode: gdk2.TExtensionMode){.
     cdecl, dynlib: lib, importc: "gtk_widget_set_extension_events".}
-proc widget_get_extension_events*(widget: PWidget): TGdkExtensionMode{.cdecl, 
+proc widget_get_extension_events*(widget: PWidget): gdk2.TExtensionMode{.cdecl, 
     dynlib: lib, importc: "gtk_widget_get_extension_events".}
 proc widget_get_toplevel*(widget: PWidget): PWidget{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_toplevel".}
 proc widget_get_ancestor*(widget: PWidget, widget_type: TType): PWidget{.cdecl, 
     dynlib: lib, importc: "gtk_widget_get_ancestor".}
-proc widget_get_colormap*(widget: PWidget): PGdkColormap{.cdecl, dynlib: lib, 
+proc widget_get_colormap*(widget: PWidget): gdk2.PColormap{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_colormap".}
-proc widget_get_visual*(widget: PWidget): PGdkVisual{.cdecl, dynlib: lib, 
+proc widget_get_visual*(widget: PWidget): gdk2.PVisual{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_visual".}
-proc widget_get_screen*(widget: PWidget): PGdkScreen{.cdecl, dynlib: lib, 
+proc widget_get_screen*(widget: PWidget): gdk2.PScreen{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_screen".}
 proc widget_has_screen*(widget: PWidget): gboolean{.cdecl, dynlib: lib, 
     importc: "gtk_widget_has_screen".}
-proc widget_get_display*(widget: PWidget): PGdkDisplay{.cdecl, dynlib: lib, 
+proc widget_get_display*(widget: PWidget): gdk2.PDisplay{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_display".}
-proc widget_get_root_window*(widget: PWidget): PGdkWindow{.cdecl, dynlib: lib, 
+proc widget_get_root_window*(widget: PWidget): gdk2.PWindow{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_root_window".}
 proc widget_get_settings*(widget: PWidget): PSettings{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_settings".}
-proc widget_get_clipboard*(widget: PWidget, selection: TGdkAtom): PClipboard{.
+proc widget_get_clipboard*(widget: PWidget, selection: gdk2.TAtom): PClipboard{.
     cdecl, dynlib: lib, importc: "gtk_widget_get_clipboard".}
-proc widget_get_accessible*(widget: PWidget): PAtkObject{.cdecl, dynlib: lib, 
+proc widget_get_accessible*(widget: PWidget): atk.PObject{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_accessible".}
-proc widget_set_colormap*(widget: PWidget, colormap: PGdkColormap){.cdecl, 
+proc widget_set_colormap*(widget: PWidget, colormap: gdk2.PColormap){.cdecl, 
     dynlib: lib, importc: "gtk_widget_set_colormap".}
 proc widget_get_events*(widget: PWidget): gint{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_events".}
@@ -3734,24 +3732,24 @@ proc widget_modify_style*(widget: PWidget, style: PRcStyle){.cdecl, dynlib: lib,
     importc: "gtk_widget_modify_style".}
 proc widget_get_modifier_style*(widget: PWidget): PRcStyle{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_modifier_style".}
-proc widget_modify_fg*(widget: PWidget, state: TStateType, color: PGdkColor){.
+proc widget_modify_fg*(widget: PWidget, state: TStateType, color: gdk2.PColor){.
     cdecl, dynlib: lib, importc: "gtk_widget_modify_fg".}
-proc widget_modify_bg*(widget: PWidget, state: TStateType, color: PGdkColor){.
+proc widget_modify_bg*(widget: PWidget, state: TStateType, color: gdk2.PColor){.
     cdecl, dynlib: lib, importc: "gtk_widget_modify_bg".}
-proc widget_modify_text*(widget: PWidget, state: TStateType, color: PGdkColor){.
+proc widget_modify_text*(widget: PWidget, state: TStateType, color: gdk2.PColor){.
     cdecl, dynlib: lib, importc: "gtk_widget_modify_text".}
-proc widget_modify_base*(widget: PWidget, state: TStateType, color: PGdkColor){.
+proc widget_modify_base*(widget: PWidget, state: TStateType, color: gdk2.PColor){.
     cdecl, dynlib: lib, importc: "gtk_widget_modify_base".}
-proc widget_modify_font*(widget: PWidget, font_desc: PPangoFontDescription){.
+proc widget_modify_font*(widget: PWidget, font_desc: pango.PFontDescription){.
     cdecl, dynlib: lib, importc: "gtk_widget_modify_font".}
-proc widget_create_pango_context*(widget: PWidget): PPangoContext{.cdecl, 
+proc widget_create_pango_context*(widget: PWidget): pango.PContext{.cdecl, 
     dynlib: lib, importc: "gtk_widget_create_pango_context".}
-proc widget_get_pango_context*(widget: PWidget): PPangoContext{.cdecl, 
+proc widget_get_pango_context*(widget: PWidget): pango.PContext{.cdecl, 
     dynlib: lib, importc: "gtk_widget_get_pango_context".}
-proc widget_create_pango_layout*(widget: PWidget, text: cstring): PPangoLayout{.
+proc widget_create_pango_layout*(widget: PWidget, text: cstring): pango.PLayout{.
     cdecl, dynlib: lib, importc: "gtk_widget_create_pango_layout".}
 proc widget_render_icon*(widget: PWidget, stock_id: cstring, size: TIconSize, 
-                         detail: cstring): PGdkPixbuf{.cdecl, dynlib: lib, 
+                         detail: cstring): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, 
     importc: "gtk_widget_render_icon".}
 proc widget_set_composite_name*(widget: PWidget, name: cstring){.cdecl, 
     dynlib: lib, importc: "gtk_widget_set_composite_name".}
@@ -3759,7 +3757,7 @@ proc widget_get_composite_name*(widget: PWidget): cstring{.cdecl, dynlib: lib,
     importc: "gtk_widget_get_composite_name".}
 proc widget_reset_rc_styles*(widget: PWidget){.cdecl, dynlib: lib, 
     importc: "gtk_widget_reset_rc_styles".}
-proc widget_push_colormap*(cmap: PGdkColormap){.cdecl, dynlib: lib, 
+proc widget_push_colormap*(cmap: gdk2.PColormap){.cdecl, dynlib: lib, 
     importc: "gtk_widget_push_colormap".}
 proc widget_push_composite_child*(){.cdecl, dynlib: lib, 
                                      importc: "gtk_widget_push_composite_child".}
@@ -3782,7 +3780,7 @@ proc widget_class_list_style_properties*(klass: PWidgetClass,
 proc widget_style_get_property*(widget: PWidget, property_name: cstring, 
                                 value: PGValue){.cdecl, dynlib: lib, 
     importc: "gtk_widget_style_get_property".}
-proc widget_set_default_colormap*(colormap: PGdkColormap){.cdecl, dynlib: lib, 
+proc widget_set_default_colormap*(colormap: gdk2.PColormap){.cdecl, dynlib: lib, 
     importc: "gtk_widget_set_default_colormap".}
 proc widget_get_default_style*(): PStyle{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_default_style".}
@@ -3794,7 +3792,7 @@ proc widget_set_default_direction*(dir: TTextDirection){.cdecl, dynlib: lib,
     importc: "gtk_widget_set_default_direction".}
 proc widget_get_default_direction*(): TTextDirection{.cdecl, dynlib: lib, 
     importc: "gtk_widget_get_default_direction".}
-proc widget_shape_combine_mask*(widget: PWidget, shape_mask: PGdkBitmap, 
+proc widget_shape_combine_mask*(widget: PWidget, shape_mask: gdk2.PBitmap, 
                                 offset_x: gint, offset_y: gint){.cdecl, 
     dynlib: lib, importc: "gtk_widget_shape_combine_mask".}
 proc widget_reset_shapes*(widget: PWidget){.cdecl, dynlib: lib, 
@@ -3815,7 +3813,7 @@ proc widget_get_aux_info*(widget: PWidget, create: gboolean): PWidgetAuxInfo{.
     cdecl, dynlib: lib, importc: "gtk_widget_get_aux_info".}
 proc widget_propagate_hierarchy_changed*(widget: PWidget, 
     previous_toplevel: PWidget){.cdecl, dynlib: lib, importc: "_gtk_widget_propagate_hierarchy_changed".}
-proc widget_peek_colormap*(): PGdkColormap{.cdecl, dynlib: lib, 
+proc widget_peek_colormap*(): gdk2.PColormap{.cdecl, dynlib: lib, 
     importc: "_gtk_widget_peek_colormap".}
 proc TYPE_MISC*(): GType
 proc MISC*(obj: pointer): PMisc
@@ -3856,7 +3854,7 @@ proc accel_group_lock*(accel_group: PAccelGroup){.cdecl, dynlib: lib,
 proc accel_group_unlock*(accel_group: PAccelGroup){.cdecl, dynlib: lib, 
     importc: "gtk_accel_group_unlock".}
 proc accel_group_connect*(accel_group: PAccelGroup, accel_key: guint, 
-                          accel_mods: TGdkModifierType, 
+                          accel_mods: gdk2.TModifierType, 
                           accel_flags: TAccelFlags, closure: PGClosure){.cdecl, 
     dynlib: lib, importc: "gtk_accel_group_connect".}
 proc accel_group_connect_by_path*(accel_group: PAccelGroup, accel_path: cstring, 
@@ -3865,14 +3863,14 @@ proc accel_group_connect_by_path*(accel_group: PAccelGroup, accel_path: cstring,
 proc accel_group_disconnect*(accel_group: PAccelGroup, closure: PGClosure): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_accel_group_disconnect".}
 proc accel_group_disconnect_key*(accel_group: PAccelGroup, accel_key: guint, 
-                                 accel_mods: TGdkModifierType): gboolean{.cdecl, 
+                                 accel_mods: gdk2.TModifierType): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_accel_group_disconnect_key".}
 proc accel_group_attach*(accel_group: PAccelGroup, anObject: PGObject){.cdecl, 
     dynlib: lib, importc: "_gtk_accel_group_attach".}
 proc accel_group_detach*(accel_group: PAccelGroup, anObject: PGObject){.cdecl, 
     dynlib: lib, importc: "_gtk_accel_group_detach".}
 proc accel_groups_activate*(anObject: PGObject, accel_key: guint, 
-                            accel_mods: TGdkModifierType): gboolean{.cdecl, 
+                            accel_mods: gdk2.TModifierType): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_accel_groups_activate".}
 proc accel_groups_from_object*(anObject: PGObject): PGSList{.cdecl, dynlib: lib, 
     importc: "gtk_accel_groups_from_object".}
@@ -3881,20 +3879,20 @@ proc accel_group_find*(accel_group: PAccelGroup,
     cdecl, dynlib: lib, importc: "gtk_accel_group_find".}
 proc accel_group_from_accel_closure*(closure: PGClosure): PAccelGroup{.cdecl, 
     dynlib: lib, importc: "gtk_accel_group_from_accel_closure".}
-proc accelerator_valid*(keyval: guint, modifiers: TGdkModifierType): gboolean{.
+proc accelerator_valid*(keyval: guint, modifiers: gdk2.TModifierType): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_accelerator_valid".}
 proc accelerator_parse*(accelerator: cstring, accelerator_key: Pguint, 
-                        accelerator_mods: PGdkModifierType){.cdecl, dynlib: lib, 
+                        accelerator_mods: gdk2.PModifierType){.cdecl, dynlib: lib, 
     importc: "gtk_accelerator_parse".}
 proc accelerator_name*(accelerator_key: guint, 
-                       accelerator_mods: TGdkModifierType): cstring{.cdecl, 
+                       accelerator_mods: gdk2.TModifierType): cstring{.cdecl, 
     dynlib: lib, importc: "gtk_accelerator_name".}
-proc accelerator_set_default_mod_mask*(default_mod_mask: TGdkModifierType){.
+proc accelerator_set_default_mod_mask*(default_mod_mask: gdk2.TModifierType){.
     cdecl, dynlib: lib, importc: "gtk_accelerator_set_default_mod_mask".}
 proc accelerator_get_default_mod_mask*(): guint{.cdecl, dynlib: lib, 
     importc: "gtk_accelerator_get_default_mod_mask".}
 proc accel_group_query*(accel_group: PAccelGroup, accel_key: guint, 
-                        accel_mods: TGdkModifierType, n_entries: Pguint): PAccelGroupEntry{.
+                        accel_mods: gdk2.TModifierType, n_entries: Pguint): PAccelGroupEntry{.
     cdecl, dynlib: lib, importc: "gtk_accel_group_query".}
 proc accel_group_reconnect*(accel_group: PAccelGroup, accel_path_quark: TGQuark){.
     cdecl, dynlib: lib, importc: "_gtk_accel_group_reconnect".}
@@ -3949,7 +3947,7 @@ proc container_foreach*(container: PContainer, callback: TCallback,
 proc container_get_children*(container: PContainer): PGList{.cdecl, dynlib: lib, 
     importc: "gtk_container_get_children".}
 proc container_propagate_expose*(container: PContainer, child: PWidget, 
-                                 event: PGdkEventExpose){.cdecl, dynlib: lib, 
+                                 event: gdk2.PEventExpose){.cdecl, dynlib: lib, 
     importc: "gtk_container_propagate_expose".}
 proc container_set_focus_chain*(container: PContainer, focusable_widgets: PGList){.
     cdecl, dynlib: lib, importc: "gtk_container_set_focus_chain".}
@@ -4138,9 +4136,9 @@ proc window_set_transient_for*(window: PWindow, parent: PWindow){.cdecl,
     dynlib: lib, importc: "gtk_window_set_transient_for".}
 proc window_get_transient_for*(window: PWindow): PWindow{.cdecl, dynlib: lib, 
     importc: "gtk_window_get_transient_for".}
-proc window_set_type_hint*(window: PWindow, hint: TGdkWindowTypeHint){.cdecl, 
+proc window_set_type_hint*(window: PWindow, hint: gdk2.TWindowTypeHint){.cdecl, 
     dynlib: lib, importc: "gtk_window_set_type_hint".}
-proc window_get_type_hint*(window: PWindow): TGdkWindowTypeHint{.cdecl, 
+proc window_get_type_hint*(window: PWindow): gdk2.TWindowTypeHint{.cdecl, 
     dynlib: lib, importc: "gtk_window_get_type_hint".}
 proc window_set_destroy_with_parent*(window: PWindow, setting: gboolean){.cdecl, 
     dynlib: lib, importc: "gtk_window_set_destroy_with_parent".}
@@ -4150,17 +4148,17 @@ proc window_set_resizable*(window: PWindow, resizable: gboolean){.cdecl,
     dynlib: lib, importc: "gtk_window_set_resizable".}
 proc window_get_resizable*(window: PWindow): gboolean{.cdecl, dynlib: lib, 
     importc: "gtk_window_get_resizable".}
-proc window_set_gravity*(window: PWindow, gravity: TGdkGravity){.cdecl, 
+proc window_set_gravity*(window: PWindow, gravity: gdk2.TGravity){.cdecl, 
     dynlib: lib, importc: "gtk_window_set_gravity".}
-proc window_get_gravity*(window: PWindow): TGdkGravity{.cdecl, dynlib: lib, 
+proc window_get_gravity*(window: PWindow): gdk2.TGravity{.cdecl, dynlib: lib, 
     importc: "gtk_window_get_gravity".}
 proc window_set_geometry_hints*(window: PWindow, geometry_widget: PWidget, 
-                                geometry: PGdkGeometry, 
-                                geom_mask: TGdkWindowHints){.cdecl, dynlib: lib, 
+                                geometry: gdk2.PGeometry, 
+                                geom_mask: gdk2.TWindowHints){.cdecl, dynlib: lib, 
     importc: "gtk_window_set_geometry_hints".}
-proc window_set_screen*(window: PWindow, screen: PGdkScreen){.cdecl, 
+proc window_set_screen*(window: PWindow, screen: gdk2.PScreen){.cdecl, 
     dynlib: lib, importc: "gtk_window_set_screen".}
-proc window_get_screen*(window: PWindow): PGdkScreen{.cdecl, dynlib: lib, 
+proc window_get_screen*(window: PWindow): gdk2.PScreen{.cdecl, dynlib: lib, 
     importc: "gtk_window_get_screen".}
 proc window_set_has_frame*(window: PWindow, setting: gboolean){.cdecl, 
     dynlib: lib, importc: "gtk_window_set_has_frame".}
@@ -4180,9 +4178,9 @@ proc window_set_icon_list*(window: PWindow, list: PGList){.cdecl, dynlib: lib,
     importc: "gtk_window_set_icon_list".}
 proc window_get_icon_list*(window: PWindow): PGList{.cdecl, dynlib: lib, 
     importc: "gtk_window_get_icon_list".}
-proc window_set_icon*(window: PWindow, icon: PGdkPixbuf){.cdecl, dynlib: lib, 
+proc window_set_icon*(window: PWindow, icon: gdk2pixbuf.PPixbuf){.cdecl, dynlib: lib, 
     importc: "gtk_window_set_icon".}
-proc window_get_icon*(window: PWindow): PGdkPixbuf{.cdecl, dynlib: lib, 
+proc window_get_icon*(window: PWindow): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, 
     importc: "gtk_window_get_icon".}
 proc window_set_default_icon_list*(list: PGList){.cdecl, dynlib: lib, 
     importc: "gtk_window_set_default_icon_list".}
@@ -4199,11 +4197,11 @@ proc window_add_mnemonic*(window: PWindow, keyval: guint, target: PWidget){.
 proc window_remove_mnemonic*(window: PWindow, keyval: guint, target: PWidget){.
     cdecl, dynlib: lib, importc: "gtk_window_remove_mnemonic".}
 proc window_mnemonic_activate*(window: PWindow, keyval: guint, 
-                               modifier: TGdkModifierType): gboolean{.cdecl, 
+                               modifier: gdk2.TModifierType): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_window_mnemonic_activate".}
-proc window_set_mnemonic_modifier*(window: PWindow, modifier: TGdkModifierType){.
+proc window_set_mnemonic_modifier*(window: PWindow, modifier: gdk2.TModifierType){.
     cdecl, dynlib: lib, importc: "gtk_window_set_mnemonic_modifier".}
-proc window_get_mnemonic_modifier*(window: PWindow): TGdkModifierType{.cdecl, 
+proc window_get_mnemonic_modifier*(window: PWindow): gdk2.TModifierType{.cdecl, 
     dynlib: lib, importc: "gtk_window_get_mnemonic_modifier".}
 proc window_present*(window: PWindow){.cdecl, dynlib: lib, 
                                        importc: "gtk_window_present".}
@@ -4219,7 +4217,7 @@ proc window_maximize*(window: PWindow){.cdecl, dynlib: lib,
                                         importc: "gtk_window_maximize".}
 proc window_unmaximize*(window: PWindow){.cdecl, dynlib: lib, 
     importc: "gtk_window_unmaximize".}
-proc window_begin_resize_drag*(window: PWindow, edge: TGdkWindowEdge, 
+proc window_begin_resize_drag*(window: PWindow, edge: gdk2.TWindowEdge, 
                                button: gint, root_x: gint, root_y: gint, 
                                timestamp: guint32){.cdecl, dynlib: lib, 
     importc: "gtk_window_begin_resize_drag".}
@@ -4265,13 +4263,13 @@ proc window_constrain_size*(window: PWindow, width: gint, height: gint,
     dynlib: lib, importc: "_gtk_window_constrain_size".}
 proc window_get_group*(window: PWindow): PWindowGroup{.cdecl, dynlib: lib, 
     importc: "_gtk_window_get_group".}
-proc window_activate_key*(window: PWindow, event: PGdkEventKey): gboolean{.
+proc window_activate_key*(window: PWindow, event: gdk2.PEventKey): gboolean{.
     cdecl, dynlib: lib, importc: "_gtk_window_activate_key".}
 proc window_keys_foreach*(window: PWindow, func: TWindowKeysForeachFunc, 
                           func_data: gpointer){.cdecl, dynlib: lib, 
     importc: "_gtk_window_keys_foreach".}
 proc window_query_nonaccels*(window: PWindow, accel_key: guint, 
-                             accel_mods: TGdkModifierType): gboolean{.cdecl, 
+                             accel_mods: gdk2.TModifierType): gboolean{.cdecl, 
     dynlib: lib, importc: "_gtk_window_query_nonaccels".}
 const 
   bm_TGtkLabel_jtype* = 0x0003'i16
@@ -4306,9 +4304,9 @@ proc label_set_text*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib,
     importc: "gtk_label_set_text".}
 proc label_get_text*(`label`: PLabel): cstring{.cdecl, dynlib: lib, 
     importc: "gtk_label_get_text".}
-proc label_set_attributes*(`label`: PLabel, attrs: PPangoAttrList){.cdecl, 
+proc label_set_attributes*(`label`: PLabel, attrs: pango.PAttrList){.cdecl, 
     dynlib: lib, importc: "gtk_label_set_attributes".}
-proc label_get_attributes*(`label`: PLabel): PPangoAttrList{.cdecl, dynlib: lib, 
+proc label_get_attributes*(`label`: PLabel): pango.PAttrList{.cdecl, dynlib: lib, 
     importc: "gtk_label_get_attributes".}
 proc label_set_label*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib, 
     importc: "gtk_label_set_label".}
@@ -4352,7 +4350,7 @@ proc label_select_region*(`label`: PLabel, start_offset: gint, end_offset: gint)
     cdecl, dynlib: lib, importc: "gtk_label_select_region".}
 proc label_get_selection_bounds*(`label`: PLabel, start: Pgint, theEnd: Pgint): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_label_get_selection_bounds".}
-proc label_get_layout*(`label`: PLabel): PPangoLayout{.cdecl, dynlib: lib, 
+proc label_get_layout*(`label`: PLabel): pango.PLayout{.cdecl, dynlib: lib, 
     importc: "gtk_label_get_layout".}
 proc label_get_layout_offsets*(`label`: PLabel, x: Pgint, y: Pgint){.cdecl, 
     dynlib: lib, importc: "gtk_label_get_layout_offsets".}
@@ -4385,12 +4383,12 @@ proc accel_label_set_accel_closure*(accel_label: PAccelLabel,
 proc accel_label_refetch*(accel_label: PAccelLabel): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_accel_label_refetch".}
 proc accel_map_add_entry*(accel_path: cstring, accel_key: guint, 
-                          accel_mods: TGdkModifierType){.cdecl, dynlib: lib, 
+                          accel_mods: gdk2.TModifierType){.cdecl, dynlib: lib, 
     importc: "gtk_accel_map_add_entry".}
 proc accel_map_lookup_entry*(accel_path: cstring, key: PAccelKey): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_accel_map_lookup_entry".}
 proc accel_map_change_entry*(accel_path: cstring, accel_key: guint, 
-                             accel_mods: TGdkModifierType, replace: gboolean): gboolean{.
+                             accel_mods: gdk2.TModifierType, replace: gboolean): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_accel_map_change_entry".}
 proc accel_map_load*(file_name: cstring){.cdecl, dynlib: lib, 
     importc: "gtk_accel_map_load".}
@@ -4522,7 +4520,7 @@ const
   bp_TGtkBindingEntry_in_emission* = 1'i16
 
 proc binding_entry_add*(binding_set: PBindingSet, keyval: guint, 
-                        modifiers: TGdkModifierType)
+                        modifiers: gdk2.TModifierType)
 proc parsed*(a: var TBindingSet): guint
 proc set_parsed*(a: var TBindingSet, `parsed`: guint)
 proc destroyed*(a: var TBindingEntry): guint
@@ -4536,27 +4534,27 @@ proc binding_set_by_class*(object_class: gpointer): PBindingSet{.cdecl,
 proc binding_set_find*(set_name: cstring): PBindingSet{.cdecl, dynlib: lib, 
     importc: "gtk_binding_set_find".}
 proc bindings_activate*(anObject: PObject, keyval: guint, 
-                        modifiers: TGdkModifierType): gboolean{.cdecl, 
+                        modifiers: gdk2.TModifierType): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_bindings_activate".}
 proc binding_set_activate*(binding_set: PBindingSet, keyval: guint, 
-                           modifiers: TGdkModifierType, anObject: PObject): gboolean{.
+                           modifiers: gdk2.TModifierType, anObject: PObject): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_binding_set_activate".}
 proc binding_entry_clear*(binding_set: PBindingSet, keyval: guint, 
-                          modifiers: TGdkModifierType){.cdecl, dynlib: lib, 
+                          modifiers: gdk2.TModifierType){.cdecl, dynlib: lib, 
     importc: "gtk_binding_entry_clear".}
 proc binding_set_add_path*(binding_set: PBindingSet, path_type: TPathType, 
                            path_pattern: cstring, priority: TPathPriorityType){.
     cdecl, dynlib: lib, importc: "gtk_binding_set_add_path".}
 proc binding_entry_remove*(binding_set: PBindingSet, keyval: guint, 
-                           modifiers: TGdkModifierType){.cdecl, dynlib: lib, 
+                           modifiers: gdk2.TModifierType){.cdecl, dynlib: lib, 
     importc: "gtk_binding_entry_remove".}
 proc binding_entry_add_signall*(binding_set: PBindingSet, keyval: guint, 
-                                modifiers: TGdkModifierType, 
+                                modifiers: gdk2.TModifierType, 
                                 signal_name: cstring, binding_args: PGSList){.
     cdecl, dynlib: lib, importc: "gtk_binding_entry_add_signall".}
 proc binding_parse_binding*(scanner: PGScanner): guint{.cdecl, dynlib: lib, 
     importc: "gtk_binding_parse_binding".}
-proc bindings_activate_event*(anObject: PObject, event: PGdkEventKey): gboolean{.
+proc bindings_activate_event*(anObject: PObject, event: gdk2.PEventKey): gboolean{.
     cdecl, dynlib: lib, importc: "_gtk_bindings_activate_event".}
 proc binding_reset_parsed*(){.cdecl, dynlib: lib, 
                               importc: "_gtk_binding_reset_parsed".}
@@ -4715,7 +4713,7 @@ proc button_get_use_stock*(button: PButton): gboolean{.cdecl, dynlib: lib,
     importc: "gtk_button_get_use_stock".}
 proc button_set_depressed*(button: PButton, depressed: gboolean){.cdecl, 
     dynlib: lib, importc: "_gtk_button_set_depressed".}
-proc button_paint*(button: PButton, area: PGdkRectangle, state_type: TStateType, 
+proc button_paint*(button: PButton, area: gdk2.PRectangle, state_type: TStateType, 
                    shadow_type: TShadowType, main_detail: cstring, 
                    default_detail: cstring){.cdecl, dynlib: lib, 
     importc: "_gtk_button_paint".}
@@ -4766,7 +4764,7 @@ proc IS_CELL_EDITABLE*(obj: pointer): bool
 proc CELL_EDITABLE_GET_IFACE*(obj: pointer): PCellEditableIface
 proc cell_editable_get_type*(): GType{.cdecl, dynlib: lib, 
                                        importc: "gtk_cell_editable_get_type".}
-proc cell_editable_start_editing*(cell_editable: PCellEditable, event: PGdkEvent){.
+proc cell_editable_start_editing*(cell_editable: PCellEditable, event: gdk2.PEvent){.
     cdecl, dynlib: lib, importc: "gtk_cell_editable_start_editing".}
 proc cell_editable_editing_done*(cell_editable: PCellEditable){.cdecl, 
     dynlib: lib, importc: "gtk_cell_editable_editing_done".}
@@ -4809,23 +4807,23 @@ proc set_cell_background_set*(a: var TCellRenderer, `cell_background_set`: guint
 proc cell_renderer_get_type*(): GType{.cdecl, dynlib: lib, 
                                        importc: "gtk_cell_renderer_get_type".}
 proc cell_renderer_get_size*(cell: PCellRenderer, widget: PWidget, 
-                             cell_area: PGdkRectangle, x_offset: Pgint, 
+                             cell_area: gdk2.PRectangle, x_offset: Pgint, 
                              y_offset: Pgint, width: Pgint, height: Pgint){.
     cdecl, dynlib: lib, importc: "gtk_cell_renderer_get_size".}
-proc cell_renderer_render*(cell: PCellRenderer, window: PGdkWindow, 
-                           widget: PWidget, background_area: PGdkRectangle, 
-                           cell_area: PGdkRectangle, expose_area: PGdkRectangle, 
+proc cell_renderer_render*(cell: PCellRenderer, window: gdk2.PWindow, 
+                           widget: PWidget, background_area: gdk2.PRectangle, 
+                           cell_area: gdk2.PRectangle, expose_area: gdk2.PRectangle, 
                            flags: TCellRendererState){.cdecl, dynlib: lib, 
     importc: "gtk_cell_renderer_render".}
-proc cell_renderer_activate*(cell: PCellRenderer, event: PGdkEvent, 
+proc cell_renderer_activate*(cell: PCellRenderer, event: gdk2.PEvent, 
                              widget: PWidget, path: cstring, 
-                             background_area: PGdkRectangle, 
-                             cell_area: PGdkRectangle, flags: TCellRendererState): gboolean{.
+                             background_area: gdk2.PRectangle, 
+                             cell_area: gdk2.PRectangle, flags: TCellRendererState): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_cell_renderer_activate".}
-proc cell_renderer_start_editing*(cell: PCellRenderer, event: PGdkEvent, 
+proc cell_renderer_start_editing*(cell: PCellRenderer, event: gdk2.PEvent, 
                                   widget: PWidget, path: cstring, 
-                                  background_area: PGdkRectangle, 
-                                  cell_area: PGdkRectangle, 
+                                  background_area: gdk2.PRectangle, 
+                                  cell_area: gdk2.PRectangle, 
                                   flags: TCellRendererState): PCellEditable{.
     cdecl, dynlib: lib, importc: "gtk_cell_renderer_start_editing".}
 proc cell_renderer_set_fixed_size*(cell: PCellRenderer, width: gint, 
@@ -5114,9 +5112,9 @@ proc check_menu_item_set_inconsistent*(check_menu_item: PCheckMenuItem,
     importc: "gtk_check_menu_item_set_inconsistent".}
 proc check_menu_item_get_inconsistent*(check_menu_item: PCheckMenuItem): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_check_menu_item_get_inconsistent".}
-proc clipboard_get_for_display*(display: PGdkDisplay, selection: TGdkAtom): PClipboard{.
+proc clipboard_get_for_display*(display: gdk2.PDisplay, selection: gdk2.TAtom): PClipboard{.
     cdecl, dynlib: lib, importc: "gtk_clipboard_get_for_display".}
-proc clipboard_get_display*(clipboard: PClipboard): PGdkDisplay{.cdecl, 
+proc clipboard_get_display*(clipboard: PClipboard): gdk2.PDisplay{.cdecl, 
     dynlib: lib, importc: "gtk_clipboard_get_display".}
 proc clipboard_set_with_data*(clipboard: PClipboard, targets: PTargetEntry, 
                               n_targets: guint, get_func: TClipboardGetFunc, 
@@ -5133,7 +5131,7 @@ proc clipboard_clear*(clipboard: PClipboard){.cdecl, dynlib: lib,
     importc: "gtk_clipboard_clear".}
 proc clipboard_set_text*(clipboard: PClipboard, text: cstring, len: gint){.
     cdecl, dynlib: lib, importc: "gtk_clipboard_set_text".}
-proc clipboard_request_contents*(clipboard: PClipboard, target: TGdkAtom, 
+proc clipboard_request_contents*(clipboard: PClipboard, target: gdk2.TAtom, 
                                  callback: TClipboardReceivedFunc, 
                                  user_data: gpointer){.cdecl, dynlib: lib, 
     importc: "gtk_clipboard_request_contents".}
@@ -5141,7 +5139,7 @@ proc clipboard_request_text*(clipboard: PClipboard,
                              callback: TClipboardTextReceivedFunc, 
                              user_data: gpointer){.cdecl, dynlib: lib, 
     importc: "gtk_clipboard_request_text".}
-proc clipboard_wait_for_contents*(clipboard: PClipboard, target: TGdkAtom): PSelectionData{.
+proc clipboard_wait_for_contents*(clipboard: PClipboard, target: gdk2.TAtom): PSelectionData{.
     cdecl, dynlib: lib, importc: "gtk_clipboard_wait_for_contents".}
 proc clipboard_wait_for_text*(clipboard: PClipboard): cstring{.cdecl, 
     dynlib: lib, importc: "gtk_clipboard_wait_for_text".}
@@ -5302,17 +5300,17 @@ proc clist_set_text*(clist: PCList, row: gint, column: gint, text: cstring){.
 proc clist_get_text*(clist: PCList, row: gint, column: gint, text: PPgchar): gint{.
     cdecl, dynlib: lib, importc: "gtk_clist_get_text".}
 proc clist_set_pixmap*(clist: PCList, row: gint, column: gint, 
-                       pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl, 
+                       pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, 
     dynlib: lib, importc: "gtk_clist_set_pixmap".}
 proc clist_get_pixmap*(clist: PCList, row: gint, column: gint, 
-                       pixmap: var PGdkPixmap, mask: var PGdkBitmap): gint{.
+                       pixmap: var gdk2.PPixmap, mask: var gdk2.PBitmap): gint{.
     cdecl, dynlib: lib, importc: "gtk_clist_get_pixmap".}
 proc clist_set_pixtext*(clist: PCList, row: gint, column: gint, text: cstring, 
-                        spacing: guint8, pixmap: PGdkPixmap, mask: PGdkBitmap){.
+                        spacing: guint8, pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.
     cdecl, dynlib: lib, importc: "gtk_clist_set_pixtext".}
-proc clist_set_foreground*(clist: PCList, row: gint, color: PGdkColor){.cdecl, 
+proc clist_set_foreground*(clist: PCList, row: gint, color: gdk2.PColor){.cdecl, 
     dynlib: lib, importc: "gtk_clist_set_foreground".}
-proc clist_set_background*(clist: PCList, row: gint, color: PGdkColor){.cdecl, 
+proc clist_set_background*(clist: PCList, row: gint, color: gdk2.PColor){.cdecl, 
     dynlib: lib, importc: "gtk_clist_set_background".}
 proc clist_set_cell_style*(clist: PCList, row: gint, column: gint, style: PStyle){.
     cdecl, dynlib: lib, importc: "gtk_clist_set_cell_style".}
@@ -5367,7 +5365,7 @@ proc clist_set_sort_type*(clist: PCList, sort_type: TSortType){.cdecl,
 proc clist_sort*(clist: PCList){.cdecl, dynlib: lib, importc: "gtk_clist_sort".}
 proc clist_set_auto_sort*(clist: PCList, auto_sort: gboolean){.cdecl, 
     dynlib: lib, importc: "gtk_clist_set_auto_sort".}
-proc clist_create_cell_layout*(clist: PCList, clist_row: PCListRow, column: gint): PPangoLayout{.
+proc clist_create_cell_layout*(clist: PCList, clist_row: PCListRow, column: gint): pango.PLayout{.
     cdecl, dynlib: lib, importc: "_gtk_clist_create_cell_layout".}
 const 
   DIALOG_MODAL* = 1 shl 0
@@ -5443,32 +5441,32 @@ proc color_selection_set_has_palette*(colorsel: PColorSelection,
                                       has_palette: gboolean){.cdecl, 
     dynlib: lib, importc: "gtk_color_selection_set_has_palette".}
 proc color_selection_set_current_color*(colorsel: PColorSelection, 
-                                        color: PGdkColor){.cdecl, dynlib: lib, 
+                                        color: gdk2.PColor){.cdecl, dynlib: lib, 
     importc: "gtk_color_selection_set_current_color".}
 proc color_selection_set_current_alpha*(colorsel: PColorSelection, 
                                         alpha: guint16){.cdecl, dynlib: lib, 
     importc: "gtk_color_selection_set_current_alpha".}
 proc color_selection_get_current_color*(colorsel: PColorSelection, 
-                                        color: PGdkColor){.cdecl, dynlib: lib, 
+                                        color: gdk2.PColor){.cdecl, dynlib: lib, 
     importc: "gtk_color_selection_get_current_color".}
 proc color_selection_get_current_alpha*(colorsel: PColorSelection): guint16{.
     cdecl, dynlib: lib, importc: "gtk_color_selection_get_current_alpha".}
 proc color_selection_set_previous_color*(colorsel: PColorSelection, 
-    color: PGdkColor){.cdecl, dynlib: lib, 
+    color: gdk2.PColor){.cdecl, dynlib: lib, 
                        importc: "gtk_color_selection_set_previous_color".}
 proc color_selection_set_previous_alpha*(colorsel: PColorSelection, 
     alpha: guint16){.cdecl, dynlib: lib, 
                      importc: "gtk_color_selection_set_previous_alpha".}
 proc color_selection_get_previous_color*(colorsel: PColorSelection, 
-    color: PGdkColor){.cdecl, dynlib: lib, 
+    color: gdk2.PColor){.cdecl, dynlib: lib, 
                        importc: "gtk_color_selection_get_previous_color".}
 proc color_selection_get_previous_alpha*(colorsel: PColorSelection): guint16{.
     cdecl, dynlib: lib, importc: "gtk_color_selection_get_previous_alpha".}
 proc color_selection_is_adjusting*(colorsel: PColorSelection): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_color_selection_is_adjusting".}
-proc color_selection_palette_from_string*(str: cstring, colors: var PGdkColor, 
+proc color_selection_palette_from_string*(str: cstring, colors: var gdk2.PColor, 
     n_colors: Pgint): gboolean{.cdecl, dynlib: lib, importc: "gtk_color_selection_palette_from_string".}
-proc color_selection_palette_to_string*(colors: PGdkColor, n_colors: gint): cstring{.
+proc color_selection_palette_to_string*(colors: gdk2.PColor, n_colors: gint): cstring{.
     cdecl, dynlib: lib, importc: "gtk_color_selection_palette_to_string".}
 proc color_selection_set_change_palette_with_screen_hook*(
     func: TColorSelectionChangePaletteWithScreenFunc): TColorSelectionChangePaletteWithScreenFunc{.
@@ -5577,8 +5575,8 @@ proc ctree_new*(columns: gint, tree_column: gint): PCTree{.cdecl, dynlib: lib,
     importc: "gtk_ctree_new".}
 proc ctree_insert_node*(ctree: PCTree, parent: PCTreeNode, sibling: PCTreeNode, 
                         text: openarray[cstring], spacing: guint8, 
-                        pixmap_closed: PGdkPixmap, mask_closed: PGdkBitmap, 
-                        pixmap_opened: PGdkPixmap, mask_opened: PGdkBitmap, 
+                        pixmap_closed: gdk2.PPixmap, mask_closed: gdk2.PBitmap, 
+                        pixmap_opened: gdk2.PPixmap, mask_opened: gdk2.PBitmap, 
                         is_leaf: gboolean, expanded: gboolean): PCTreeNode{.
     cdecl, dynlib: lib, importc: "gtk_ctree_insert_node".}
 proc ctree_remove_node*(ctree: PCTree, node_: PCTreeNode){.cdecl, dynlib: lib, 
@@ -5662,16 +5660,16 @@ proc ctree_node_set_text*(ctree: PCTree, node_: PCTreeNode, column: gint,
                           text: cstring){.cdecl, dynlib: lib, 
     importc: "gtk_ctree_node_set_text".}
 proc ctree_node_set_pixmap*(ctree: PCTree, node_: PCTreeNode, column: gint, 
-                            pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl, 
+                            pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, 
     dynlib: lib, importc: "gtk_ctree_node_set_pixmap".}
 proc ctree_node_set_pixtext*(ctree: PCTree, node_: PCTreeNode, column: gint, 
-                             text: cstring, spacing: guint8, pixmap: PGdkPixmap, 
-                             mask: PGdkBitmap){.cdecl, dynlib: lib, 
+                             text: cstring, spacing: guint8, pixmap: gdk2.PPixmap, 
+                             mask: gdk2.PBitmap){.cdecl, dynlib: lib, 
     importc: "gtk_ctree_node_set_pixtext".}
 proc ctree_set_node_info*(ctree: PCTree, node_: PCTreeNode, text: cstring, 
-                          spacing: guint8, pixmap_closed: PGdkPixmap, 
-                          mask_closed: PGdkBitmap, pixmap_opened: PGdkPixmap, 
-                          mask_opened: PGdkBitmap, is_leaf: gboolean, 
+                          spacing: guint8, pixmap_closed: gdk2.PPixmap, 
+                          mask_closed: gdk2.PBitmap, pixmap_opened: gdk2.PPixmap, 
+                          mask_opened: gdk2.PBitmap, is_leaf: gboolean, 
                           expanded: gboolean){.cdecl, dynlib: lib, 
     importc: "gtk_ctree_set_node_info".}
 proc ctree_node_set_shift*(ctree: PCTree, node_: PCTreeNode, column: gint, 
@@ -5697,10 +5695,10 @@ proc ctree_node_set_cell_style*(ctree: PCTree, node_: PCTreeNode, column: gint,
 proc ctree_node_get_cell_style*(ctree: PCTree, node_: PCTreeNode, column: gint): PStyle{.
     cdecl, dynlib: lib, importc: "gtk_ctree_node_get_cell_style".}
 proc ctree_node_set_foreground*(ctree: PCTree, node_: PCTreeNode, 
-                                color: PGdkColor){.cdecl, dynlib: lib, 
+                                color: gdk2.PColor){.cdecl, dynlib: lib, 
     importc: "gtk_ctree_node_set_foreground".}
 proc ctree_node_set_background*(ctree: PCTree, node_: PCTreeNode, 
-                                color: PGdkColor){.cdecl, dynlib: lib, 
+                                color: gdk2.PColor){.cdecl, dynlib: lib, 
     importc: "gtk_ctree_node_set_background".}
 proc ctree_node_set_row_data*(ctree: PCTree, node_: PCTreeNode, data: gpointer){.
     cdecl, dynlib: lib, importc: "gtk_ctree_node_set_row_data".}
@@ -5768,12 +5766,12 @@ const
   TARGET_SAME_APP* = 1 shl 0
   TARGET_SAME_WIDGET* = 1 shl 1
 
-proc drag_get_data*(widget: PWidget, context: PGdkDragContext, target: TGdkAtom, 
+proc drag_get_data*(widget: PWidget, context: gdk2.PDragContext, target: gdk2.TAtom, 
                     time: guint32){.cdecl, dynlib: lib, 
                                     importc: "gtk_drag_get_data".}
-proc drag_finish*(context: PGdkDragContext, success: gboolean, del: gboolean, 
+proc drag_finish*(context: gdk2.PDragContext, success: gboolean, del: gboolean, 
                   time: guint32){.cdecl, dynlib: lib, importc: "gtk_drag_finish".}
-proc drag_get_source_widget*(context: PGdkDragContext): PWidget{.cdecl, 
+proc drag_get_source_widget*(context: gdk2.PDragContext): PWidget{.cdecl, 
     dynlib: lib, importc: "gtk_drag_get_source_widget".}
 proc drag_highlight*(widget: PWidget){.cdecl, dynlib: lib, 
                                        importc: "gtk_drag_highlight".}
@@ -5781,57 +5779,57 @@ proc drag_unhighlight*(widget: PWidget){.cdecl, dynlib: lib,
     importc: "gtk_drag_unhighlight".}
 proc drag_dest_set*(widget: PWidget, flags: TDestDefaults, 
                     targets: PTargetEntry, n_targets: gint, 
-                    actions: TGdkDragAction){.cdecl, dynlib: lib, 
+                    actions: gdk2.TDragAction){.cdecl, dynlib: lib, 
     importc: "gtk_drag_dest_set".}
-proc drag_dest_set_proxy*(widget: PWidget, proxy_window: PGdkWindow, 
-                          protocol: TGdkDragProtocol, use_coordinates: gboolean){.
+proc drag_dest_set_proxy*(widget: PWidget, proxy_window: gdk2.PWindow, 
+                          protocol: gdk2.TDragProtocol, use_coordinates: gboolean){.
     cdecl, dynlib: lib, importc: "gtk_drag_dest_set_proxy".}
 proc drag_dest_unset*(widget: PWidget){.cdecl, dynlib: lib, 
                                         importc: "gtk_drag_dest_unset".}
-proc drag_dest_find_target*(widget: PWidget, context: PGdkDragContext, 
-                            target_list: PTargetList): TGdkAtom{.cdecl, 
+proc drag_dest_find_target*(widget: PWidget, context: gdk2.PDragContext, 
+                            target_list: PTargetList): gdk2.TAtom{.cdecl, 
     dynlib: lib, importc: "gtk_drag_dest_find_target".}
 proc drag_dest_get_target_list*(widget: PWidget): PTargetList{.cdecl, 
     dynlib: lib, importc: "gtk_drag_dest_get_target_list".}
 proc drag_dest_set_target_list*(widget: PWidget, target_list: PTargetList){.
     cdecl, dynlib: lib, importc: "gtk_drag_dest_set_target_list".}
-proc drag_source_set*(widget: PWidget, start_button_mask: TGdkModifierType, 
+proc drag_source_set*(widget: PWidget, start_button_mask: gdk2.TModifierType, 
                       targets: PTargetEntry, n_targets: gint, 
-                      actions: TGdkDragAction){.cdecl, dynlib: lib, 
+                      actions: gdk2.TDragAction){.cdecl, dynlib: lib, 
     importc: "gtk_drag_source_set".}
 proc drag_source_unset*(widget: PWidget){.cdecl, dynlib: lib, 
     importc: "gtk_drag_source_unset".}
-proc drag_source_set_icon*(widget: PWidget, colormap: PGdkColormap, 
-                           pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl, 
+proc drag_source_set_icon*(widget: PWidget, colormap: gdk2.PColormap, 
+                           pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, 
     dynlib: lib, importc: "gtk_drag_source_set_icon".}
-proc drag_source_set_icon_pixbuf*(widget: PWidget, pixbuf: PGdkPixbuf){.cdecl, 
+proc drag_source_set_icon_pixbuf*(widget: PWidget, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, 
     dynlib: lib, importc: "gtk_drag_source_set_icon_pixbuf".}
 proc drag_source_set_icon_stock*(widget: PWidget, stock_id: cstring){.cdecl, 
     dynlib: lib, importc: "gtk_drag_source_set_icon_stock".}
-proc drag_begin*(widget: PWidget, targets: PTargetList, actions: TGdkDragAction, 
-                 button: gint, event: PGdkEvent): PGdkDragContext{.cdecl, 
+proc drag_begin*(widget: PWidget, targets: PTargetList, actions: gdk2.TDragAction, 
+                 button: gint, event: gdk2.PEvent): gdk2.PDragContext{.cdecl, 
     dynlib: lib, importc: "gtk_drag_begin".}
-proc drag_set_icon_widget*(context: PGdkDragContext, widget: PWidget, 
+proc drag_set_icon_widget*(context: gdk2.PDragContext, widget: PWidget, 
                            hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, 
     importc: "gtk_drag_set_icon_widget".}
-proc drag_set_icon_pixmap*(context: PGdkDragContext, colormap: PGdkColormap, 
-                           pixmap: PGdkPixmap, mask: PGdkBitmap, hot_x: gint, 
+proc drag_set_icon_pixmap*(context: gdk2.PDragContext, colormap: gdk2.PColormap, 
+                           pixmap: gdk2.PPixmap, mask: gdk2.PBitmap, hot_x: gint, 
                            hot_y: gint){.cdecl, dynlib: lib, 
     importc: "gtk_drag_set_icon_pixmap".}
-proc drag_set_icon_pixbuf*(context: PGdkDragContext, pixbuf: PGdkPixbuf, 
+proc drag_set_icon_pixbuf*(context: gdk2.PDragContext, pixbuf: gdk2pixbuf.PPixbuf, 
                            hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, 
     importc: "gtk_drag_set_icon_pixbuf".}
-proc drag_set_icon_stock*(context: PGdkDragContext, stock_id: cstring, 
+proc drag_set_icon_stock*(context: gdk2.PDragContext, stock_id: cstring, 
                           hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, 
     importc: "gtk_drag_set_icon_stock".}
-proc drag_set_icon_default*(context: PGdkDragContext){.cdecl, dynlib: lib, 
+proc drag_set_icon_default*(context: gdk2.PDragContext){.cdecl, dynlib: lib, 
     importc: "gtk_drag_set_icon_default".}
 proc drag_check_threshold*(widget: PWidget, start_x: gint, start_y: gint, 
                            current_x: gint, current_y: gint): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_drag_check_threshold".}
-proc drag_source_handle_event*(widget: PWidget, event: PGdkEvent){.cdecl, 
+proc drag_source_handle_event*(widget: PWidget, event: gdk2.PEvent){.cdecl, 
     dynlib: lib, importc: "_gtk_drag_source_handle_event".}
-proc drag_dest_handle_event*(toplevel: PWidget, event: PGdkEvent){.cdecl, 
+proc drag_dest_handle_event*(toplevel: PWidget, event: gdk2.PEvent){.cdecl, 
     dynlib: lib, importc: "_gtk_drag_dest_handle_event".}
 proc TYPE_EDITABLE*(): GType
 proc EDITABLE*(obj: pointer): PEditable
@@ -5877,9 +5875,9 @@ proc IS_IM_CONTEXT_CLASS*(klass: pointer): bool
 proc IM_CONTEXT_GET_CLASS*(obj: pointer): PIMContextClass
 proc im_context_get_type*(): TType{.cdecl, dynlib: lib, 
                                     importc: "gtk_im_context_get_type".}
-proc im_context_set_client_window*(context: PIMContext, window: PGdkWindow){.
+proc im_context_set_client_window*(context: PIMContext, window: gdk2.PWindow){.
     cdecl, dynlib: lib, importc: "gtk_im_context_set_client_window".}
-proc im_context_filter_keypress*(context: PIMContext, event: PGdkEventKey): gboolean{.
+proc im_context_filter_keypress*(context: PIMContext, event: gdk2.PEventKey): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_im_context_filter_keypress".}
 proc im_context_focus_in*(context: PIMContext){.cdecl, dynlib: lib, 
     importc: "gtk_im_context_focus_in".}
@@ -5887,7 +5885,7 @@ proc im_context_focus_out*(context: PIMContext){.cdecl, dynlib: lib,
     importc: "gtk_im_context_focus_out".}
 proc im_context_reset*(context: PIMContext){.cdecl, dynlib: lib, 
     importc: "gtk_im_context_reset".}
-proc im_context_set_cursor_location*(context: PIMContext, area: PGdkRectangle){.
+proc im_context_set_cursor_location*(context: PIMContext, area: gdk2.PRectangle){.
     cdecl, dynlib: lib, importc: "gtk_im_context_set_cursor_location".}
 proc im_context_set_use_preedit*(context: PIMContext, use_preedit: gboolean){.
     cdecl, dynlib: lib, importc: "gtk_im_context_set_use_preedit".}
@@ -6033,7 +6031,7 @@ proc menu_get_title*(menu: PMenu): cstring{.cdecl, dynlib: lib,
     importc: "gtk_menu_get_title".}
 proc menu_reorder_child*(menu: PMenu, child: PWidget, position: gint){.cdecl, 
     dynlib: lib, importc: "gtk_menu_reorder_child".}
-proc menu_set_screen*(menu: PMenu, screen: PGdkScreen){.cdecl, dynlib: lib, 
+proc menu_set_screen*(menu: PMenu, screen: gdk2.PScreen){.cdecl, dynlib: lib, 
     importc: "gtk_menu_set_screen".}
 const 
   bm_TGtkEntry_editable* = 0x0001'i16
@@ -6125,7 +6123,7 @@ proc entry_set_text*(entry: PEntry, text: cstring){.cdecl, dynlib: lib,
     importc: "gtk_entry_set_text".}
 proc entry_get_text*(entry: PEntry): cstring{.cdecl, dynlib: lib, 
     importc: "gtk_entry_get_text".}
-proc entry_get_layout*(entry: PEntry): PPangoLayout{.cdecl, dynlib: lib, 
+proc entry_get_layout*(entry: PEntry): pango.PLayout{.cdecl, dynlib: lib, 
     importc: "gtk_entry_get_layout".}
 proc entry_get_layout_offsets*(entry: PEntry, x: Pgint, y: Pgint){.cdecl, 
     dynlib: lib, importc: "gtk_entry_get_layout_offsets".}
@@ -6151,9 +6149,9 @@ const
   ARROW_DOWN* = 1
   ARROW_LEFT* = 2
   ARROW_RIGHT* = 3
-  EXPAND* = 1 shl 0
-  SHRINK* = 1 shl 1
-  FILL* = 1 shl 2
+  constEXPAND* = 1 shl 0
+  constSHRINK* = 1 shl 1
+  constFILL* = 1 shl 2
   BUTTONBOX_DEFAULT_STYLE* = 0
   BUTTONBOX_SPREAD* = 1
   BUTTONBOX_EDGE* = 2
@@ -6414,10 +6412,10 @@ proc gamma_curve_get_type*(): TType{.cdecl, dynlib: lib,
                                      importc: "gtk_gamma_curve_get_type".}
 proc gamma_curve_new*(): PGammaCurve{.cdecl, dynlib: lib, 
                                       importc: "gtk_gamma_curve_new".}
-proc gc_get*(depth: gint, colormap: PGdkColormap, values: PGdkGCValues, 
-             values_mask: TGdkGCValuesMask): PGdkGC{.cdecl, dynlib: lib, 
+proc gc_get*(depth: gint, colormap: gdk2.PColormap, values: gdk2.PGCValues, 
+             values_mask: gdk2.TGCValuesMask): gdk2.PGC{.cdecl, dynlib: lib, 
     importc: "gtk_gc_get".}
-proc gc_release*(gc: PGdkGC){.cdecl, dynlib: lib, importc: "gtk_gc_release".}
+proc gc_release*(gc: gdk2.PGC){.cdecl, dynlib: lib, importc: "gtk_gc_release".}
 const 
   bm_TGtkHandleBox_handle_position* = 0x0003'i16
   bp_TGtkHandleBox_handle_position* = 0'i16
@@ -6586,7 +6584,7 @@ proc IS_SETTINGS_CLASS*(klass: pointer): bool
 proc SETTINGS_GET_CLASS*(obj: pointer): PSettingsClass
 proc settings_get_type*(): GType{.cdecl, dynlib: lib, 
                                   importc: "gtk_settings_get_type".}
-proc settings_get_for_screen*(screen: PGdkScreen): PSettings{.cdecl, 
+proc settings_get_for_screen*(screen: gdk2.PScreen): PSettings{.cdecl, 
     dynlib: lib, importc: "gtk_settings_get_for_screen".}
 proc settings_install_property*(pspec: PGParamSpec){.cdecl, dynlib: lib, 
     importc: "gtk_settings_install_property".}
@@ -6620,7 +6618,7 @@ proc settings_set_long_property*(settings: PSettings, name: cstring,
 proc settings_set_double_property*(settings: PSettings, name: cstring, 
                                    v_double: gdouble, origin: cstring){.cdecl, 
     dynlib: lib, importc: "gtk_settings_set_double_property".}
-proc settings_handle_event*(event: PGdkEventSetting){.cdecl, dynlib: lib, 
+proc settings_handle_event*(event: gdk2.PEventSetting){.cdecl, dynlib: lib, 
     importc: "_gtk_settings_handle_event".}
 proc rc_property_parser_from_type*(thetype: GType): TRcPropertyParser{.cdecl, 
     dynlib: lib, importc: "_gtk_rc_property_parser_from_type".}
@@ -6686,7 +6684,7 @@ proc rc_get_im_module_file*(): cstring{.cdecl, dynlib: lib,
                                         importc: "gtk_rc_get_im_module_file".}
 proc rc_scanner_new*(): PGScanner{.cdecl, dynlib: lib, 
                                    importc: "gtk_rc_scanner_new".}
-proc rc_parse_color*(scanner: PGScanner, color: PGdkColor): guint{.cdecl, 
+proc rc_parse_color*(scanner: PGScanner, color: gdk2.PColor): guint{.cdecl, 
     dynlib: lib, importc: "gtk_rc_parse_color".}
 proc rc_parse_state*(scanner: PGScanner, state: PStateType): guint{.cdecl, 
     dynlib: lib, importc: "gtk_rc_parse_state".}
@@ -6709,117 +6707,117 @@ proc style_get_type*(): GType{.cdecl, dynlib: lib, importc: "gtk_style_get_type"
 proc style_new*(): PStyle{.cdecl, dynlib: lib, importc: "gtk_style_new".}
 proc style_copy*(style: PStyle): PStyle{.cdecl, dynlib: lib, 
     importc: "gtk_style_copy".}
-proc style_attach*(style: PStyle, window: PGdkWindow): PStyle{.cdecl, 
+proc style_attach*(style: PStyle, window: gdk2.PWindow): PStyle{.cdecl, 
     dynlib: lib, importc: "gtk_style_attach".}
 proc style_detach*(style: PStyle){.cdecl, dynlib: lib, 
                                    importc: "gtk_style_detach".}
-proc style_set_background*(style: PStyle, window: PGdkWindow, 
+proc style_set_background*(style: PStyle, window: gdk2.PWindow, 
                            state_type: TStateType){.cdecl, dynlib: lib, 
     importc: "gtk_style_set_background".}
-proc style_apply_default_background*(style: PStyle, window: PGdkWindow, 
+proc style_apply_default_background*(style: PStyle, window: gdk2.PWindow, 
                                      set_bg: gboolean, state_type: TStateType, 
-                                     area: PGdkRectangle, x: gint, y: gint, 
+                                     area: gdk2.PRectangle, x: gint, y: gint, 
                                      width: gint, height: gint){.cdecl, 
     dynlib: lib, importc: "gtk_style_apply_default_background".}
 proc style_lookup_icon_set*(style: PStyle, stock_id: cstring): PIconSet{.cdecl, 
     dynlib: lib, importc: "gtk_style_lookup_icon_set".}
 proc style_render_icon*(style: PStyle, source: PIconSource, 
                         direction: TTextDirection, state: TStateType, 
-                        size: TIconSize, widget: PWidget, detail: cstring): PGdkPixbuf{.
+                        size: TIconSize, widget: PWidget, detail: cstring): gdk2pixbuf.PPixbuf{.
     cdecl, dynlib: lib, importc: "gtk_style_render_icon".}
-proc paint_hline*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                  area: PGdkRectangle, widget: PWidget, detail: cstring, 
+proc paint_hline*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                  area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                   x1: gint, x2: gint, y: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_hline".}
-proc paint_vline*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                  area: PGdkRectangle, widget: PWidget, detail: cstring, 
+proc paint_vline*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                  area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                   y1: gint, y2: gint, x: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_vline".}
-proc paint_shadow*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                   shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_shadow*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                   shadow_type: TShadowType, area: gdk2.PRectangle, 
                    widget: PWidget, detail: cstring, x: gint, y: gint, 
                    width: gint, height: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_shadow".}
-proc paint_polygon*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                    shadow_type: TShadowType, area: PGdkRectangle, 
-                    widget: PWidget, detail: cstring, points: PGdkPoint, 
+proc paint_polygon*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                    shadow_type: TShadowType, area: gdk2.PRectangle, 
+                    widget: PWidget, detail: cstring, points: gdk2.PPoint, 
                     npoints: gint, fill: gboolean){.cdecl, dynlib: lib, 
     importc: "gtk_paint_polygon".}
-proc paint_arrow*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                  shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_arrow*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                  shadow_type: TShadowType, area: gdk2.PRectangle, 
                   widget: PWidget, detail: cstring, arrow_type: TArrowType, 
                   fill: gboolean, x: gint, y: gint, width: gint, height: gint){.
     cdecl, dynlib: lib, importc: "gtk_paint_arrow".}
-proc paint_diamond*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                    shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_diamond*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                    shadow_type: TShadowType, area: gdk2.PRectangle, 
                     widget: PWidget, detail: cstring, x: gint, y: gint, 
                     width: gint, height: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_diamond".}
-proc paint_box*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                shadow_type: TShadowType, area: PGdkRectangle, widget: PWidget, 
+proc paint_box*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                shadow_type: TShadowType, area: gdk2.PRectangle, widget: PWidget, 
                 detail: cstring, x: gint, y: gint, width: gint, height: gint){.
     cdecl, dynlib: lib, importc: "gtk_paint_box".}
-proc paint_flat_box*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                     shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_flat_box*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                     shadow_type: TShadowType, area: gdk2.PRectangle, 
                      widget: PWidget, detail: cstring, x: gint, y: gint, 
                      width: gint, height: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_flat_box".}
-proc paint_check*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                  shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_check*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                  shadow_type: TShadowType, area: gdk2.PRectangle, 
                   widget: PWidget, detail: cstring, x: gint, y: gint, 
                   width: gint, height: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_check".}
-proc paint_option*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                   shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_option*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                   shadow_type: TShadowType, area: gdk2.PRectangle, 
                    widget: PWidget, detail: cstring, x: gint, y: gint, 
                    width: gint, height: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_option".}
-proc paint_tab*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                shadow_type: TShadowType, area: PGdkRectangle, widget: PWidget, 
+proc paint_tab*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                shadow_type: TShadowType, area: gdk2.PRectangle, widget: PWidget, 
                 detail: cstring, x: gint, y: gint, width: gint, height: gint){.
     cdecl, dynlib: lib, importc: "gtk_paint_tab".}
-proc paint_shadow_gap*(style: PStyle, window: PGdkWindow, 
+proc paint_shadow_gap*(style: PStyle, window: gdk2.PWindow, 
                        state_type: TStateType, shadow_type: TShadowType, 
-                       area: PGdkRectangle, widget: PWidget, detail: cstring, 
+                       area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                        x: gint, y: gint, width: gint, height: gint, 
                        gap_side: TPositionType, gap_x: gint, gap_width: gint){.
     cdecl, dynlib: lib, importc: "gtk_paint_shadow_gap".}
-proc paint_box_gap*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                    shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_box_gap*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                    shadow_type: TShadowType, area: gdk2.PRectangle, 
                     widget: PWidget, detail: cstring, x: gint, y: gint, 
                     width: gint, height: gint, gap_side: TPositionType, 
                     gap_x: gint, gap_width: gint){.cdecl, dynlib: lib, 
     importc: "gtk_paint_box_gap".}
-proc paint_extension*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                      shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_extension*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                      shadow_type: TShadowType, area: gdk2.PRectangle, 
                       widget: PWidget, detail: cstring, x: gint, y: gint, 
                       width: gint, height: gint, gap_side: TPositionType){.
     cdecl, dynlib: lib, importc: "gtk_paint_extension".}
-proc paint_focus*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                  area: PGdkRectangle, widget: PWidget, detail: cstring, 
+proc paint_focus*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                  area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                   x: gint, y: gint, width: gint, height: gint){.cdecl, 
     dynlib: lib, importc: "gtk_paint_focus".}
-proc paint_slider*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                   shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_slider*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                   shadow_type: TShadowType, area: gdk2.PRectangle, 
                    widget: PWidget, detail: cstring, x: gint, y: gint, 
                    width: gint, height: gint, orientation: TOrientation){.cdecl, 
     dynlib: lib, importc: "gtk_paint_slider".}
-proc paint_handle*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                   shadow_type: TShadowType, area: PGdkRectangle, 
+proc paint_handle*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                   shadow_type: TShadowType, area: gdk2.PRectangle, 
                    widget: PWidget, detail: cstring, x: gint, y: gint, 
                    width: gint, height: gint, orientation: TOrientation){.cdecl, 
     dynlib: lib, importc: "gtk_paint_handle".}
-proc paint_expander*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                     area: PGdkRectangle, widget: PWidget, detail: cstring, 
+proc paint_expander*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                     area: gdk2.PRectangle, widget: PWidget, detail: cstring, 
                      x: gint, y: gint, expander_style: TExpanderStyle){.cdecl, 
     dynlib: lib, importc: "gtk_paint_expander".}
-proc paint_layout*(style: PStyle, window: PGdkWindow, state_type: TStateType, 
-                   use_text: gboolean, area: PGdkRectangle, widget: PWidget, 
-                   detail: cstring, x: gint, y: gint, layout: PPangoLayout){.
+proc paint_layout*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, 
+                   use_text: gboolean, area: gdk2.PRectangle, widget: PWidget, 
+                   detail: cstring, x: gint, y: gint, layout: pango.PLayout){.
     cdecl, dynlib: lib, importc: "gtk_paint_layout".}
-proc paint_resize_grip*(style: PStyle, window: PGdkWindow, 
-                        state_type: TStateType, area: PGdkRectangle, 
-                        widget: PWidget, detail: cstring, edge: TGdkWindowEdge, 
+proc paint_resize_grip*(style: PStyle, window: gdk2.PWindow, 
+                        state_type: TStateType, area: gdk2.PRectangle, 
+                        widget: PWidget, detail: cstring, edge: gdk2.TWindowEdge, 
                         x: gint, y: gint, width: gint, height: gint){.cdecl, 
     dynlib: lib, importc: "gtk_paint_resize_grip".}
 proc border_get_type*(): GType{.cdecl, dynlib: lib, 
@@ -6831,10 +6829,10 @@ proc border_free*(border: PBorder){.cdecl, dynlib: lib,
 proc style_peek_property_value*(style: PStyle, widget_type: GType, 
                                 pspec: PGParamSpec, parser: TRcPropertyParser): PGValue{.
     cdecl, dynlib: lib, importc: "_gtk_style_peek_property_value".}
-proc get_insertion_cursor_gc*(widget: PWidget, is_primary: gboolean): PGdkGC{.
+proc get_insertion_cursor_gc*(widget: PWidget, is_primary: gboolean): gdk2.PGC{.
     cdecl, dynlib: lib, importc: "_gtk_get_insertion_cursor_gc".}
-proc draw_insertion_cursor*(widget: PWidget, drawable: PGdkDrawable, gc: PGdkGC, 
-                            location: PGdkRectangle, direction: TTextDirection, 
+proc draw_insertion_cursor*(widget: PWidget, drawable: gdk2.PDrawable, gc: gdk2.PGC, 
+                            location: gdk2.PRectangle, direction: TTextDirection, 
                             draw_arrow: gboolean){.cdecl, dynlib: lib, 
     importc: "_gtk_draw_insertion_cursor".}
 const 
@@ -7023,7 +7021,7 @@ proc icon_size_get_name*(size: TIconSize): cstring{.cdecl, dynlib: lib,
 proc icon_set_get_type*(): GType{.cdecl, dynlib: lib, 
                                   importc: "gtk_icon_set_get_type".}
 proc icon_set_new*(): PIconSet{.cdecl, dynlib: lib, importc: "gtk_icon_set_new".}
-proc icon_set_new_from_pixbuf*(pixbuf: PGdkPixbuf): PIconSet{.cdecl, 
+proc icon_set_new_from_pixbuf*(pixbuf: gdk2pixbuf.PPixbuf): PIconSet{.cdecl, 
     dynlib: lib, importc: "gtk_icon_set_new_from_pixbuf".}
 proc icon_set_ref*(icon_set: PIconSet): PIconSet{.cdecl, dynlib: lib, 
     importc: "gtk_icon_set_ref".}
@@ -7033,7 +7031,7 @@ proc icon_set_copy*(icon_set: PIconSet): PIconSet{.cdecl, dynlib: lib,
     importc: "gtk_icon_set_copy".}
 proc icon_set_render_icon*(icon_set: PIconSet, style: PStyle, 
                            direction: TTextDirection, state: TStateType, 
-                           size: TIconSize, widget: PWidget, detail: cstring): PGdkPixbuf{.
+                           size: TIconSize, widget: PWidget, detail: cstring): gdk2pixbuf.PPixbuf{.
     cdecl, dynlib: lib, importc: "gtk_icon_set_render_icon".}
 proc icon_set_add_source*(icon_set: PIconSet, source: PIconSource){.cdecl, 
     dynlib: lib, importc: "gtk_icon_set_add_source".}
@@ -7050,11 +7048,11 @@ proc icon_source_free*(source: PIconSource){.cdecl, dynlib: lib,
     importc: "gtk_icon_source_free".}
 proc icon_source_set_filename*(source: PIconSource, filename: cstring){.cdecl, 
     dynlib: lib, importc: "gtk_icon_source_set_filename".}
-proc icon_source_set_pixbuf*(source: PIconSource, pixbuf: PGdkPixbuf){.cdecl, 
+proc icon_source_set_pixbuf*(source: PIconSource, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, 
     dynlib: lib, importc: "gtk_icon_source_set_pixbuf".}
 proc icon_source_get_filename*(source: PIconSource): cstring{.cdecl, 
     dynlib: lib, importc: "gtk_icon_source_get_filename".}
-proc icon_source_get_pixbuf*(source: PIconSource): PGdkPixbuf{.cdecl, 
+proc icon_source_get_pixbuf*(source: PIconSource): gdk2pixbuf.PPixbuf{.cdecl, 
     dynlib: lib, importc: "gtk_icon_source_get_pixbuf".}
 proc icon_source_set_direction_wildcarded*(source: PIconSource, 
     setting: gboolean){.cdecl, dynlib: lib, 
@@ -7093,41 +7091,41 @@ proc IS_IMAGE_CLASS*(klass: pointer): bool
 proc IMAGE_GET_CLASS*(obj: pointer): PImageClass
 proc image_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_image_get_type".}
 proc image_new*(): PImage{.cdecl, dynlib: lib, importc: "gtk_image_new".}
-proc image_new_from_pixmap*(pixmap: PGdkPixmap, mask: PGdkBitmap): PImage{.
+proc image_new_from_pixmap*(pixmap: gdk2.PPixmap, mask: gdk2.PBitmap): PImage{.
     cdecl, dynlib: lib, importc: "gtk_image_new_from_pixmap".}
-proc image_new_from_image*(image: PGdkImage, mask: PGdkBitmap): PImage{.cdecl, 
+proc image_new_from_image*(image: gdk2.PImage, mask: gdk2.PBitmap): PImage{.cdecl, 
     dynlib: lib, importc: "gtk_image_new_from_image".}
 proc image_new_from_file*(filename: cstring): PImage{.cdecl, dynlib: lib, 
     importc: "gtk_image_new_from_file".}
-proc image_new_from_pixbuf*(pixbuf: PGdkPixbuf): PImage{.cdecl, dynlib: lib, 
+proc image_new_from_pixbuf*(pixbuf: gdk2pixbuf.PPixbuf): PImage{.cdecl, dynlib: lib, 
     importc: "gtk_image_new_from_pixbuf".}
 proc image_new_from_stock*(stock_id: cstring, size: TIconSize): PImage{.cdecl, 
     dynlib: lib, importc: "gtk_image_new_from_stock".}
 proc image_new_from_icon_set*(icon_set: PIconSet, size: TIconSize): PImage{.
     cdecl, dynlib: lib, importc: "gtk_image_new_from_icon_set".}
-proc image_new_from_animation*(animation: PGdkPixbufAnimation): PImage{.cdecl, 
+proc image_new_from_animation*(animation: gdk2pixbuf.PPixbufAnimation): PImage{.cdecl, 
     dynlib: lib, importc: "gtk_image_new_from_animation".}
-proc image_set_from_pixmap*(image: PImage, pixmap: PGdkPixmap, mask: PGdkBitmap){.
+proc image_set_from_pixmap*(image: PImage, pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.
     cdecl, dynlib: lib, importc: "gtk_image_set_from_pixmap".}
-proc image_set_from_image*(image: PImage, gdk_image: PGdkImage, mask: PGdkBitmap){.
+proc image_set_from_image*(image: PImage, gdk_image: gdk2.PImage, mask: gdk2.PBitmap){.
     cdecl, dynlib: lib, importc: "gtk_image_set_from_image".}
 proc image_set_from_file*(image: PImage, filename: cstring){.cdecl, dynlib: lib, 
     importc: "gtk_image_set_from_file".}
-proc image_set_from_pixbuf*(image: PImage, pixbuf: PGdkPixbuf){.cdecl, 
+proc image_set_from_pixbuf*(image: PImage, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, 
     dynlib: lib, importc: "gtk_image_set_from_pixbuf".}
 proc image_set_from_stock*(image: PImage, stock_id: cstring, size: TIconSize){.
     cdecl, dynlib: lib, importc: "gtk_image_set_from_stock".}
 proc image_set_from_icon_set*(image: PImage, icon_set: PIconSet, size: TIconSize){.
     cdecl, dynlib: lib, importc: "gtk_image_set_from_icon_set".}
-proc image_set_from_animation*(image: PImage, animation: PGdkPixbufAnimation){.
+proc image_set_from_animation*(image: PImage, animation: gdk2pixbuf.PPixbufAnimation){.
     cdecl, dynlib: lib, importc: "gtk_image_set_from_animation".}
 proc image_get_storage_type*(image: PImage): TImageType{.cdecl, dynlib: lib, 
     importc: "gtk_image_get_storage_type".}
-proc image_get_pixbuf*(image: PImage): PGdkPixbuf{.cdecl, dynlib: lib, 
+proc image_get_pixbuf*(image: PImage): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, 
     importc: "gtk_image_get_pixbuf".}
 proc image_get_stock*(image: PImage, stock_id: PPgchar, size: PIconSize){.cdecl, 
     dynlib: lib, importc: "gtk_image_get_stock".}
-proc image_get_animation*(image: PImage): PGdkPixbufAnimation{.cdecl, 
+proc image_get_animation*(image: PImage): gdk2pixbuf.PPixbufAnimation{.cdecl, 
     dynlib: lib, importc: "gtk_image_get_animation".}
 proc TYPE_IMAGE_MENU_ITEM*(): GType
 proc IMAGE_MENU_ITEM*(obj: pointer): PImageMenuItem
@@ -7202,11 +7200,11 @@ proc invisible_get_type*(): TType{.cdecl, dynlib: lib,
                                    importc: "gtk_invisible_get_type".}
 proc invisible_new*(): PInvisible{.cdecl, dynlib: lib, 
                                    importc: "gtk_invisible_new".}
-proc invisible_new_for_screen*(screen: PGdkScreen): PInvisible{.cdecl, 
+proc invisible_new_for_screen*(screen: gdk2.PScreen): PInvisible{.cdecl, 
     dynlib: lib, importc: "gtk_invisible_new_for_screen".}
-proc invisible_set_screen*(invisible: PInvisible, screen: PGdkScreen){.cdecl, 
+proc invisible_set_screen*(invisible: PInvisible, screen: gdk2.PScreen){.cdecl, 
     dynlib: lib, importc: "gtk_invisible_set_screen".}
-proc invisible_get_screen*(invisible: PInvisible): PGdkScreen{.cdecl, 
+proc invisible_get_screen*(invisible: PInvisible): gdk2.PScreen{.cdecl, 
     dynlib: lib, importc: "gtk_invisible_get_screen".}
 proc TYPE_ITEM_FACTORY*(): GType
 proc ITEM_FACTORY*(anObject: pointer): PItemFactory
@@ -7224,7 +7222,7 @@ proc item_factory_construct*(ifactory: PItemFactory, container_type: TType,
     dynlib: lib, importc: "gtk_item_factory_construct".}
 proc item_factory_add_foreign*(accel_widget: PWidget, full_path: cstring, 
                                accel_group: PAccelGroup, keyval: guint, 
-                               modifiers: TGdkModifierType){.cdecl, dynlib: lib, 
+                               modifiers: gdk2.TModifierType){.cdecl, dynlib: lib, 
     importc: "gtk_item_factory_add_foreign".}
 proc item_factory_from_widget*(widget: PWidget): PItemFactory{.cdecl, 
     dynlib: lib, importc: "gtk_item_factory_from_widget".}
@@ -7597,10 +7595,10 @@ proc check_version*(required_major: guint, required_minor: guint,
     importc: "gtk_check_version".}
 proc disable_setlocale*(){.cdecl, dynlib: lib, importc: "gtk_disable_setlocale".}
 proc set_locale*(): cstring{.cdecl, dynlib: lib, importc: "gtk_set_locale".}
-proc get_default_language*(): PPangoLanguage{.cdecl, dynlib: lib, 
+proc get_default_language*(): pango.PLanguage{.cdecl, dynlib: lib, 
     importc: "gtk_get_default_language".}
 proc events_pending*(): gint{.cdecl, dynlib: lib, importc: "gtk_events_pending".}
-proc main_do_event*(event: PGdkEvent){.cdecl, dynlib: lib, 
+proc main_do_event*(event: gdk2.PEvent){.cdecl, dynlib: lib, 
                                        importc: "gtk_main_do_event".}
 proc main*(){.cdecl, dynlib: lib, importc: "gtk_main".}
 proc init*(argc, argv: pointer){.cdecl, dynlib: lib, importc: "gtk_init".}
@@ -7610,8 +7608,8 @@ proc main_iteration*(): gboolean{.cdecl, dynlib: lib,
                                   importc: "gtk_main_iteration".}
 proc main_iteration_do*(blocking: gboolean): gboolean{.cdecl, dynlib: lib, 
     importc: "gtk_main_iteration_do".}
-proc true*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_true".}
-proc false*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_false".}
+proc gtkTrue*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_true".}
+proc gtkFalse*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_false".}
 proc grab_add*(widget: PWidget){.cdecl, dynlib: lib, importc: "gtk_grab_add".}
 proc grab_get_current*(): PWidget{.cdecl, dynlib: lib, 
                                    importc: "gtk_grab_get_current".}
@@ -7651,8 +7649,8 @@ proc idle_remove*(idle_handler_id: guint){.cdecl, dynlib: lib,
     importc: "gtk_idle_remove".}
 proc idle_remove_by_data*(data: gpointer){.cdecl, dynlib: lib, 
     importc: "gtk_idle_remove_by_data".}
-proc input_add_full*(source: gint, condition: TGdkInputCondition, 
-                     `function`: TGdkInputFunction, marshal: TCallbackMarshal, 
+proc input_add_full*(source: gint, condition: gdk2.TInputCondition, 
+                     `function`: gdk2.TInputFunction, marshal: TCallbackMarshal, 
                      data: gpointer, destroy: TDestroyNotify): guint{.cdecl, 
     dynlib: lib, importc: "gtk_input_add_full".}
 proc input_remove*(input_handler_id: guint){.cdecl, dynlib: lib, 
@@ -7661,15 +7659,15 @@ proc key_snooper_install*(snooper: TKeySnoopFunc, func_data: gpointer): guint{.
     cdecl, dynlib: lib, importc: "gtk_key_snooper_install".}
 proc key_snooper_remove*(snooper_handler_id: guint){.cdecl, dynlib: lib, 
     importc: "gtk_key_snooper_remove".}
-proc get_current_event*(): PGdkEvent{.cdecl, dynlib: lib, 
+proc get_current_event*(): gdk2.PEvent{.cdecl, dynlib: lib, 
                                       importc: "gtk_get_current_event".}
 proc get_current_event_time*(): guint32{.cdecl, dynlib: lib, 
     importc: "gtk_get_current_event_time".}
-proc get_current_event_state*(state: PGdkModifierType): gboolean{.cdecl, 
+proc get_current_event_state*(state: gdk2.PModifierType): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_get_current_event_state".}
-proc get_event_widget*(event: PGdkEvent): PWidget{.cdecl, dynlib: lib, 
+proc get_event_widget*(event: gdk2.PEvent): PWidget{.cdecl, dynlib: lib, 
     importc: "gtk_get_event_widget".}
-proc propagate_event*(widget: PWidget, event: PGdkEvent){.cdecl, dynlib: lib, 
+proc propagate_event*(widget: PWidget, event: gdk2.PEvent){.cdecl, dynlib: lib, 
     importc: "gtk_propagate_event".}
 proc boolean_handled_accumulator*(ihint: PGSignalInvocationHint, 
                                   return_accu: PGValue, handler_return: PGValue, 
@@ -7903,11 +7901,11 @@ proc build_insensitive*(a: var TPixmap): guint
 proc set_build_insensitive*(a: var TPixmap, `build_insensitive`: guint)
 proc pixmap_get_type*(): TType{.cdecl, dynlib: lib, 
                                 importc: "gtk_pixmap_get_type".}
-proc pixmap_new*(pixmap: PGdkPixmap, mask: PGdkBitmap): PPixmap{.cdecl, 
+proc pixmap_new*(pixmap: gdk2.PPixmap, mask: gdk2.PBitmap): PPixmap{.cdecl, 
     dynlib: lib, importc: "gtk_pixmap_new".}
-proc pixmap_set*(pixmap: PPixmap, val: PGdkPixmap, mask: PGdkBitmap){.cdecl, 
+proc pixmap_set*(pixmap: PPixmap, val: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, 
     dynlib: lib, importc: "gtk_pixmap_set".}
-proc pixmap_get*(pixmap: PPixmap, val: var PGdkPixmap, mask: var PGdkBitmap){.
+proc pixmap_get*(pixmap: PPixmap, val: var gdk2.PPixmap, mask: var gdk2.PBitmap){.
     cdecl, dynlib: lib, importc: "gtk_pixmap_get".}
 proc pixmap_set_build_insensitive*(pixmap: PPixmap, build: gboolean){.cdecl, 
     dynlib: lib, importc: "gtk_pixmap_set_build_insensitive".}
@@ -7924,12 +7922,12 @@ proc PLUG_GET_CLASS*(obj: pointer): PPlugClass
 proc same_app*(a: var TPlug): guint
 proc set_same_app*(a: var TPlug, `same_app`: guint)
 proc plug_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_plug_get_type".}
-proc plug_construct_for_display*(plug: PPlug, display: PGdkDisplay, 
-                                 socket_id: TGdkNativeWindow){.cdecl, 
+proc plug_construct_for_display*(plug: PPlug, display: gdk2.PDisplay, 
+                                 socket_id: gdk2.TNativeWindow){.cdecl, 
     dynlib: lib, importc: "gtk_plug_construct_for_display".}
-proc plug_new_for_display*(display: PGdkDisplay, socket_id: TGdkNativeWindow): PPlug{.
+proc plug_new_for_display*(display: gdk2.PDisplay, socket_id: gdk2.TNativeWindow): PPlug{.
     cdecl, dynlib: lib, importc: "gtk_plug_new_for_display".}
-proc plug_get_id*(plug: PPlug): TGdkNativeWindow{.cdecl, dynlib: lib, 
+proc plug_get_id*(plug: PPlug): gdk2.TNativeWindow{.cdecl, dynlib: lib, 
     importc: "gtk_plug_get_id".}
 proc plug_add_to_socket*(plug: PPlug, socket: PSocket){.cdecl, dynlib: lib, 
     importc: "_gtk_plug_add_to_socket".}
@@ -7958,7 +7956,7 @@ proc preview_new*(thetype: TPreviewClass): PPreview{.cdecl, dynlib: lib,
     importc: "gtk_preview_new".}
 proc preview_size*(preview: PPreview, width: gint, height: gint){.cdecl, 
     dynlib: lib, importc: "gtk_preview_size".}
-proc preview_put*(preview: PPreview, window: PGdkWindow, gc: PGdkGC, srcx: gint, 
+proc preview_put*(preview: PPreview, window: gdk2.PWindow, gc: gdk2.PGC, srcx: gint, 
                   srcy: gint, destx: gint, desty: gint, width: gint, 
                   height: gint){.cdecl, dynlib: lib, importc: "gtk_preview_put".}
 proc preview_draw_row*(preview: PPreview, data: Pguchar, x: gint, y: gint, 
@@ -7975,7 +7973,7 @@ proc preview_set_install_cmap*(install_cmap: gint){.cdecl, dynlib: lib,
     importc: "gtk_preview_set_install_cmap".}
 proc preview_set_reserved*(nreserved: gint){.cdecl, dynlib: lib, 
     importc: "gtk_preview_set_reserved".}
-proc preview_set_dither*(preview: PPreview, dither: TGdkRgbDither){.cdecl, 
+proc preview_set_dither*(preview: PPreview, dither: gdk2.TRgbDither){.cdecl, 
     dynlib: lib, importc: "gtk_preview_set_dither".}
 proc preview_get_info*(): PPreviewInfo{.cdecl, dynlib: lib, 
                                         importc: "gtk_preview_get_info".}
@@ -8145,33 +8143,33 @@ proc target_list_ref*(list: PTargetList){.cdecl, dynlib: lib,
     importc: "gtk_target_list_ref".}
 proc target_list_unref*(list: PTargetList){.cdecl, dynlib: lib, 
     importc: "gtk_target_list_unref".}
-proc target_list_add*(list: PTargetList, target: TGdkAtom, flags: guint, 
+proc target_list_add*(list: PTargetList, target: gdk2.TAtom, flags: guint, 
                       info: guint){.cdecl, dynlib: lib, 
                                     importc: "gtk_target_list_add".}
 proc target_list_add_table*(list: PTargetList, targets: PTargetEntry, 
                             ntargets: guint){.cdecl, dynlib: lib, 
     importc: "gtk_target_list_add_table".}
-proc target_list_remove*(list: PTargetList, target: TGdkAtom){.cdecl, 
+proc target_list_remove*(list: PTargetList, target: gdk2.TAtom){.cdecl, 
     dynlib: lib, importc: "gtk_target_list_remove".}
-proc target_list_find*(list: PTargetList, target: TGdkAtom, info: Pguint): gboolean{.
+proc target_list_find*(list: PTargetList, target: gdk2.TAtom, info: Pguint): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_target_list_find".}
-proc selection_owner_set*(widget: PWidget, selection: TGdkAtom, time: guint32): gboolean{.
+proc selection_owner_set*(widget: PWidget, selection: gdk2.TAtom, time: guint32): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_selection_owner_set".}
-proc selection_owner_set_for_display*(display: PGdkDisplay, widget: PWidget, 
-                                      selection: TGdkAtom, time: guint32): gboolean{.
+proc selection_owner_set_for_display*(display: gdk2.PDisplay, widget: PWidget, 
+                                      selection: gdk2.TAtom, time: guint32): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_selection_owner_set_for_display".}
-proc selection_add_target*(widget: PWidget, selection: TGdkAtom, 
-                           target: TGdkAtom, info: guint){.cdecl, dynlib: lib, 
+proc selection_add_target*(widget: PWidget, selection: gdk2.TAtom, 
+                           target: gdk2.TAtom, info: guint){.cdecl, dynlib: lib, 
     importc: "gtk_selection_add_target".}
-proc selection_add_targets*(widget: PWidget, selection: TGdkAtom, 
+proc selection_add_targets*(widget: PWidget, selection: gdk2.TAtom, 
                             targets: PTargetEntry, ntargets: guint){.cdecl, 
     dynlib: lib, importc: "gtk_selection_add_targets".}
-proc selection_clear_targets*(widget: PWidget, selection: TGdkAtom){.cdecl, 
+proc selection_clear_targets*(widget: PWidget, selection: gdk2.TAtom){.cdecl, 
     dynlib: lib, importc: "gtk_selection_clear_targets".}
-proc selection_convert*(widget: PWidget, selection: TGdkAtom, target: TGdkAtom, 
+proc selection_convert*(widget: PWidget, selection: gdk2.TAtom, target: gdk2.TAtom, 
                         time: guint32): gboolean{.cdecl, dynlib: lib, 
     importc: "gtk_selection_convert".}
-proc selection_data_set*(selection_data: PSelectionData, thetype: TGdkAtom, 
+proc selection_data_set*(selection_data: PSelectionData, thetype: gdk2.TAtom, 
                          format: gint, data: Pguchar, length: gint){.cdecl, 
     dynlib: lib, importc: "gtk_selection_data_set".}
 proc selection_data_set_text*(selection_data: PSelectionData, str: cstring, 
@@ -8183,15 +8181,15 @@ proc selection_data_targets_include_text*(selection_data: PSelectionData): gbool
     cdecl, dynlib: lib, importc: "gtk_selection_data_targets_include_text".}
 proc selection_remove_all*(widget: PWidget){.cdecl, dynlib: lib, 
     importc: "gtk_selection_remove_all".}
-proc selection_clear*(widget: PWidget, event: PGdkEventSelection): gboolean{.
+proc selection_clear*(widget: PWidget, event: gdk2.PEventSelection): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_selection_clear".}
-proc selection_request*(widget: PWidget, event: PGdkEventSelection): gboolean{.
+proc selection_request*(widget: PWidget, event: gdk2.PEventSelection): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_selection_request".}
-proc selection_incr_event*(window: PGdkWindow, event: PGdkEventProperty): gboolean{.
+proc selection_incr_event*(window: gdk2.PWindow, event: gdk2.PEventProperty): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_selection_incr_event".}
-proc selection_notify*(widget: PWidget, event: PGdkEventSelection): gboolean{.
+proc selection_notify*(widget: PWidget, event: gdk2.PEventSelection): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_selection_notify".}
-proc selection_property_notify*(widget: PWidget, event: PGdkEventProperty): gboolean{.
+proc selection_property_notify*(widget: PWidget, event: gdk2.PEventProperty): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_selection_property_notify".}
 proc selection_data_get_type*(): GType{.cdecl, dynlib: lib, 
                                         importc: "gtk_selection_data_get_type".}
@@ -8275,9 +8273,9 @@ proc set_is_mapped*(a: var TSocket, `is_mapped`: guint)
 proc socket_new*(): PSocket{.cdecl, dynlib: lib, importc: "gtk_socket_new".}
 proc socket_get_type*(): TType{.cdecl, dynlib: lib, 
                                 importc: "gtk_socket_get_type".}
-proc socket_add_id*(socket: PSocket, window_id: TGdkNativeWindow){.cdecl, 
+proc socket_add_id*(socket: PSocket, window_id: gdk2.TNativeWindow){.cdecl, 
     dynlib: lib, importc: "gtk_socket_add_id".}
-proc socket_get_id*(socket: PSocket): TGdkNativeWindow{.cdecl, dynlib: lib, 
+proc socket_get_id*(socket: PSocket): gdk2.TNativeWindow{.cdecl, dynlib: lib, 
     importc: "gtk_socket_get_id".}
 const 
   INPUT_ERROR* = - (1)
@@ -8654,7 +8652,7 @@ proc text_get_length*(text: PText): guint{.cdecl, dynlib: lib,
     importc: "gtk_text_get_length".}
 proc text_freeze*(text: PText){.cdecl, dynlib: lib, importc: "gtk_text_freeze".}
 proc text_thaw*(text: PText){.cdecl, dynlib: lib, importc: "gtk_text_thaw".}
-proc text_insert*(text: PText, font: PGdkFont, fore: PGdkColor, back: PGdkColor, 
+proc text_insert*(text: PText, font: gdk2.PFont, fore: gdk2.PColor, back: gdk2.PColor, 
                   chars: cstring, length: gint){.cdecl, dynlib: lib, 
     importc: "gtk_text_insert".}
 proc text_backward_delete*(text: PText, nchars: guint): gboolean{.cdecl, 
@@ -8698,7 +8696,7 @@ proc text_iter_get_visible_slice*(start: PTextIter, theEnd: PTextIter): cstring{
     cdecl, dynlib: lib, importc: "gtk_text_iter_get_visible_slice".}
 proc text_iter_get_visible_text*(start: PTextIter, theEnd: PTextIter): cstring{.
     cdecl, dynlib: lib, importc: "gtk_text_iter_get_visible_text".}
-proc text_iter_get_pixbuf*(iter: PTextIter): PGdkPixbuf{.cdecl, dynlib: lib, 
+proc text_iter_get_pixbuf*(iter: PTextIter): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, 
     importc: "gtk_text_iter_get_pixbuf".}
 proc text_iter_get_marks*(iter: PTextIter): PGSList{.cdecl, dynlib: lib, 
     importc: "gtk_text_iter_get_marks".}
@@ -8744,7 +8742,7 @@ proc text_iter_get_bytes_in_line*(iter: PTextIter): gint{.cdecl, dynlib: lib,
     importc: "gtk_text_iter_get_bytes_in_line".}
 proc text_iter_get_attributes*(iter: PTextIter, values: PTextAttributes): gboolean{.
     cdecl, dynlib: lib, importc: "gtk_text_iter_get_attributes".}
-proc text_iter_get_language*(iter: PTextIter): PPangoLanguage{.cdecl, 
+proc text_iter_get_language*(iter: PTextIter): pango.PLanguage{.cdecl, 
     dynlib: lib, importc: "gtk_text_iter_get_language".}
 proc text_iter_is_end*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, 
     importc: "gtk_text_iter_is_end".}
@@ -8847,7 +8845,7 @@ proc text_tag_get_priority*(tag: PTextTag): gint{.cdecl, dynlib: lib,
     importc: "gtk_text_tag_get_priority".}
 proc text_tag_set_priority*(tag: PTextTag, priority: gint){.cdecl, dynlib: lib, 
     importc: "gtk_text_tag_set_priority".}
-proc text_tag_event*(tag: PTextTag, event_object: PGObject, event: PGdkEvent, 
+proc text_tag_event*(tag: PTextTag, event_object: PGObject, event: gdk2.PEvent, 
                      iter: PTextIter): gboolean{.cdecl, dynlib: lib, 
     importc: "gtk_text_tag_event".}
 proc text_attributes_new*(): PTextAttributes{.cdecl, dynlib: lib, 
@@ -9106,7 +9104,7 @@ proc text_child_anchor_get_widgets*(anchor: PTextChildAnchor): PGList{.cdecl,
     dynlib: lib, importc: "gtk_text_child_anchor_get_widgets".}
 proc text_child_anchor_get_deleted*(anchor: PTextChildAnchor): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_text_child_anchor_get_deleted".}
-proc pixbuf_segment_new*(pixbuf: PGdkPixbuf): PTextLineSegment{.cdecl, 
+proc pixbuf_segment_new*(pixbuf: gdk2pixbuf.PPixbuf): PTextLineSegment{.cdecl, 
     dynlib: lib, importc: "_gtk_pixbuf_segment_new".}
 proc widget_segment_new*(anchor: PTextChildAnchor): PTextLineSegment{.cdecl, 
     dynlib: lib, importc: "_gtk_widget_segment_new".}
@@ -9151,7 +9149,7 @@ proc text_btree_delete*(start: PTextIter, theEnd: PTextIter){.cdecl,
     dynlib: lib, importc: "_gtk_text_btree_delete".}
 proc text_btree_insert*(iter: PTextIter, text: cstring, len: gint){.cdecl, 
     dynlib: lib, importc: "_gtk_text_btree_insert".}
-proc text_btree_insert_pixbuf*(iter: PTextIter, pixbuf: PGdkPixbuf){.cdecl, 
+proc text_btree_insert_pixbuf*(iter: PTextIter, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, 
     dynlib: lib, importc: "_gtk_text_btree_insert_pixbuf".}
 proc text_btree_insert_child_anchor*(iter: PTextIter, anchor: PTextChildAnchor){.
     cdecl, dynlib: lib, importc: "_gtk_text_btree_insert_child_anchor".}
@@ -9402,7 +9400,7 @@ proc text_buffer_get_slice*(buffer: PTextBuffer, start: PTextIter,
                             theEnd: PTextIter, include_hidden_chars: gboolean): cstring{.
     cdecl, dynlib: lib, importc: "gtk_text_buffer_get_slice".}
 proc text_buffer_insert_pixbuf*(buffer: PTextBuffer, iter: PTextIter, 
-                                pixbuf: PGdkPixbuf){.cdecl, dynlib: lib, 
+                                pixbuf: gdk2pixbuf.PPixbuf){.cdecl, dynlib: lib, 
     importc: "gtk_text_buffer_insert_pixbuf".}
 proc text_buffer_insert_child_anchor*(buffer: PTextBuffer, iter: PTextIter, 
                                       anchor: PTextChildAnchor){.cdecl, 
@@ -9503,7 +9501,7 @@ proc text_buffer_get_btree*(buffer: PTextBuffer): PTextBTree{.cdecl,
     dynlib: lib, importc: "_gtk_text_buffer_get_btree".}
 proc text_buffer_get_line_log_attrs*(buffer: PTextBuffer, 
                                      anywhere_in_line: PTextIter, 
-                                     char_len: Pgint): PPangoLogAttr{.cdecl, 
+                                     char_len: Pgint): pango.PLogAttr{.cdecl, 
     dynlib: lib, importc: "_gtk_text_buffer_get_line_log_attrs".}
 proc text_buffer_notify_will_remove_tag*(buffer: PTextBuffer, tag: PTextTag){.
     cdecl, dynlib: lib, importc: "_gtk_text_buffer_notify_will_remove_tag".}
@@ -9543,8 +9541,8 @@ proc text_layout_get_buffer*(layout: PTextLayout): PTextBuffer{.cdecl,
     dynlib: lib, importc: "gtk_text_layout_get_buffer".}
 proc text_layout_set_default_style*(layout: PTextLayout, values: PTextAttributes){.
     cdecl, dynlib: lib, importc: "gtk_text_layout_set_default_style".}
-proc text_layout_set_contexts*(layout: PTextLayout, ltr_context: PPangoContext, 
-                               rtl_context: PPangoContext){.cdecl, dynlib: lib, 
+proc text_layout_set_contexts*(layout: PTextLayout, ltr_context: pango.PContext, 
+                               rtl_context: pango.PContext){.cdecl, dynlib: lib, 
     importc: "gtk_text_layout_set_contexts".}
 proc text_layout_set_cursor_direction*(layout: PTextLayout, 
                                        direction: TTextDirection){.cdecl, 
@@ -9555,7 +9553,7 @@ proc text_layout_set_screen_width*(layout: PTextLayout, width: gint){.cdecl,
     dynlib: lib, importc: "gtk_text_layout_set_screen_width".}
 proc text_layout_set_preedit_string*(layout: PTextLayout, 
                                      preedit_string: cstring, 
-                                     preedit_attrs: PPangoAttrList, 
+                                     preedit_attrs: pango.PAttrList, 
                                      cursor_pos: gint){.cdecl, dynlib: lib, 
     importc: "gtk_text_layout_set_preedit_string".}
 proc text_layout_set_cursor_visible*(layout: PTextLayout, 
@@ -9604,7 +9602,7 @@ proc text_layout_changed*(layout: PTextLayout, y: gint, old_height: gint,
                           new_height: gint){.cdecl, dynlib: lib, 
     importc: "gtk_text_layout_changed".}
 proc text_layout_get_iter_location*(layout: PTextLayout, iter: PTextIter, 
-                                    rect: PGdkRectangle){.cdecl, dynlib: lib, 
+                                    rect: gdk2.PRectangle){.cdecl, dynlib: lib, 
     importc: "gtk_text_layout_get_iter_location".}
 proc text_layout_get_line_yrange*(layout: PTextLayout, iter: PTextIter, 
                                   y: Pgint, height: Pgint){.cdecl, dynlib: lib, 
@@ -9613,8 +9611,8 @@ proc text_layout_get_line_xrange*(layout: PTextLayout, iter: PTextIter,
                                   x: Pgint, width: Pgint){.cdecl, dynlib: lib, 
     importc: "_gtk_text_layout_get_line_xrange".}
 proc text_layout_get_cursor_locations*(layout: PTextLayout, iter: PTextIter, 
-                                       strong_pos: PGdkRectangle, 
-                                       weak_pos: PGdkRectangle){.cdecl, 
+                                       strong_pos: gdk2.PRectangle, 
+                                       weak_pos: gdk2.PRectangle){.cdecl, 
     dynlib: lib, importc: "gtk_text_layout_get_cursor_locations".}
 proc text_layout_clamp_iter_to_vrange*(layout: PTextLayout, iter: PTextIter, 
                                        top: gint, bottom: gint): gboolean{.
@@ -9715,14 +9713,14 @@ proc text_view_move_mark_onscreen*(text_view: PTextView, mark: PTextMark): gbool
 proc text_view_place_cursor_onscreen*(text_view: PTextView): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_text_view_place_cursor_onscreen".}
 proc text_view_get_visible_rect*(text_view: PTextView, 
-                                 visible_rect: PGdkRectangle){.cdecl, 
+                                 visible_rect: gdk2.PRectangle){.cdecl, 
     dynlib: lib, importc: "gtk_text_view_get_visible_rect".}
 proc text_view_set_cursor_visible*(text_view: PTextView, setting: gboolean){.
     cdecl, dynlib: lib, importc: "gtk_text_view_set_cursor_visible".}
 proc text_view_get_cursor_visible*(text_view: PTextView): gboolean{.cdecl, 
     dynlib: lib, importc: "gtk_text_view_get_cursor_visible".}
 proc text_view_get_iter_location*(text_view: PTextView, iter: PTextIter, 
-                                  location: PGdkRectangle){.cdecl, dynlib: lib, 
+                                  location: gdk2.PRectangle){.cdecl, dynlib: lib, 
     importc: "gtk_text_view_get_iter_location".}
 proc text_view_get_iter_at_location*(text_view: PTextView, iter: PTextIter, 
                                      x: gint, y: gint){.cdecl, dynlib: lib, 
@@ -9743,9 +9741,9 @@ proc text_view_window_to_buffer_coords*(text_view: PTextView,
                                         window_y: gint, buffer_x: Pgint, 
                                         buffer_y: Pgint){.cdecl, dynlib: lib, 
     importc: "gtk_text_view_window_to_buffer_coords".}
-proc text_view_get_window*(text_view: PTextView, win: TTextWindowType): PGdkWindow{.
+proc text_view_get_window*(text_view: PTextView, win: TTextWindowType): gdk2.PWindow{.
     cdecl, dynlib: lib, importc: "gtk_text_view_get_window".}
-proc text_view_get_window_type*(text_view: PTextView, window: PGdkWindow): TTextWindowType{.
+proc text_view_get_window_type*(text_view: PTextView, window: gdk2.PWindow): TTextWindowType{.
     cdecl, dynlib: lib, importc: "gtk_text_view_get_window_type".}
 proc text_view_set_border_window_size*(text_view: PTextView, 
                                        thetype: TTextWindowType, size: gint){.
@@ -9815,9 +9813,9 @@ proc text_view_set_indent*(text_view: PTextView, indent: gint){.cdecl,
     dynlib: lib, importc: "gtk_text_view_set_indent".}
 proc text_view_get_indent*(text_view: PTextView): gint{.cdecl, dynlib: lib, 
     importc: "gtk_text_view_get_indent".}
-proc text_view_set_tabs*(text_view: PTextView, tabs: PPangoTabArray){.cdecl, 
+proc text_view_set_tabs*(text_view: PTextView, tabs: pango.PTabArray){.cdecl, 
     dynlib: lib, importc: "gtk_text_view_set_tabs".}
-proc text_view_get_tabs*(text_view: PTextView): PPangoTabArray{.cdecl, 
+proc text_view_get_tabs*(text_view: PTextView): pango.PTabArray{.cdecl, 
     dynlib: lib, importc: "gtk_text_view_get_tabs".}
 proc text_view_get_default_attributes*(text_view: PTextView): PTextAttributes{.
     cdecl, dynlib: lib, importc: "gtk_text_view_get_default_attributes".}
@@ -10344,7 +10342,7 @@ proc tree_view_column_cell_set_cell_data*(tree_column: PTreeViewColumn,
     is_expanded: gboolean){.cdecl, dynlib: lib, 
                             importc: "gtk_tree_view_column_cell_set_cell_data".}
 proc tree_view_column_cell_get_size*(tree_column: PTreeViewColumn, 
-                                     cell_area: PGdkRectangle, x_offset: Pgint, 
+                                     cell_area: gdk2.PRectangle, x_offset: Pgint, 
                                      y_offset: Pgint, width: Pgint, 
                                      height: Pgint){.cdecl, dynlib: lib, 
     importc: "gtk_tree_view_column_cell_get_size".}
@@ -10502,7 +10500,7 @@ proc set_enable_search*(a: var TTreeViewPrivate, `enable_search`: guint)
 proc disable_popdown*(a: var TTreeViewPrivate): guint
 proc set_disable_popdown*(a: var TTreeViewPrivate, `disable_popdown`: guint)
 proc tree_selection_internal_select_node*(selection: PTreeSelection, 
-    node_: PRBNode, tree: PRBTree, path: PTreePath, state: TGdkModifierType, 
+    node_: PRBNode, tree: PRBTree, path: PTreePath, state: gdk2.TModifierType, 
     override_browse_mode: gboolean){.cdecl, dynlib: lib, importc: "_gtk_tree_selection_internal_select_node".}
 proc tree_view_find_node*(tree_view: PTreeView, path: PTreePath, 
                           tree: var PRBTree, node_: var PRBNode): gboolean{.
@@ -10513,7 +10511,7 @@ proc tree_view_child_move_resize*(tree_view: PTreeView, widget: PWidget,
                                   x: gint, y: gint, width: gint, height: gint){.
     cdecl, dynlib: lib, importc: "_gtk_tree_view_child_move_resize".}
 proc tree_view_queue_draw_node*(tree_view: PTreeView, tree: PRBTree, 
-                                node_: PRBNode, clip_rect: PGdkRectangle){.
+                                node_: PRBNode, clip_rect: gdk2.PRectangle){.
     cdecl, dynlib: lib, importc: "_gtk_tree_view_queue_draw_node".}
 proc tree_view_column_realize_button*(column: PTreeViewColumn){.cdecl, 
     dynlib: lib, importc: "_gtk_tree_view_column_realize_button".}
@@ -10554,19 +10552,19 @@ proc tree_selection_set_tree_view*(selection: PTreeSelection,
                                    tree_view: PTreeView){.cdecl, dynlib: lib, 
     importc: "_gtk_tree_selection_set_tree_view".}
 proc tree_view_column_cell_render*(tree_column: PTreeViewColumn, 
-                                   window: PGdkWindow, 
-                                   background_area: PGdkRectangle, 
-                                   cell_area: PGdkRectangle, 
-                                   expose_area: PGdkRectangle, flags: guint){.
+                                   window: gdk2.PWindow, 
+                                   background_area: gdk2.PRectangle, 
+                                   cell_area: gdk2.PRectangle, 
+                                   expose_area: gdk2.PRectangle, flags: guint){.
     cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_render".}
 proc tree_view_column_cell_focus*(tree_column: PTreeViewColumn, direction: gint, 
                                   left: gboolean, right: gboolean): gboolean{.
     cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_focus".}
 proc tree_view_column_cell_draw_focus*(tree_column: PTreeViewColumn, 
-                                       window: PGdkWindow, 
-                                       background_area: PGdkRectangle, 
-                                       cell_area: PGdkRectangle, 
-                                       expose_area: PGdkRectangle, flags: guint){.
+                                       window: gdk2.PWindow, 
+                                       background_area: gdk2.PRectangle, 
+                                       cell_area: gdk2.PRectangle, 
+                                       expose_area: gdk2.PRectangle, flags: guint){.
     cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_draw_focus".}
 proc tree_view_column_cell_set_dirty*(tree_column: PTreeViewColumn, 
                                       install_handler: gboolean){.cdecl, 
@@ -10675,16 +10673,16 @@ proc tree_view_set_cursor_on_cell*(tree_view: PTreeView, path: PTreePath,
                                    focus_cell: PCellRenderer, 
                                    start_editing: gboolean){.cdecl, dynlib: lib, 
     importc: "gtk_tree_view_set_cursor_on_cell".}
-proc tree_view_get_bin_window*(tree_view: PTreeView): PGdkWindow{.cdecl, 
+proc tree_view_get_bin_window*(tree_view: PTreeView): gdk2.PWindow{.cdecl, 
     dynlib: lib, importc: "gtk_tree_view_get_bin_window".}
 proc tree_view_get_cell_area*(tree_view: PTreeView, path: PTreePath, 
-                              column: PTreeViewColumn, rect: PGdkRectangle){.
+                              column: PTreeViewColumn, rect: gdk2.PRectangle){.
     cdecl, dynlib: lib, importc: "gtk_tree_view_get_cell_area".}
 proc tree_view_get_background_area*(tree_view: PTreeView, path: PTreePath, 
-                                    column: PTreeViewColumn, rect: PGdkRectangle){.
+                                    column: PTreeViewColumn, rect: gdk2.PRectangle){.
     cdecl, dynlib: lib, importc: "gtk_tree_view_get_background_area".}
 proc tree_view_get_visible_rect*(tree_view: PTreeView, 
-                                 visible_rect: PGdkRectangle){.cdecl, 
+                                 visible_rect: gdk2.PRectangle){.cdecl, 
     dynlib: lib, importc: "gtk_tree_view_get_visible_rect".}
 proc tree_view_widget_to_tree_coords*(tree_view: PTreeView, wx: gint, wy: gint, 
                                       tx: Pgint, ty: Pgint){.cdecl, dynlib: lib, 
@@ -10693,12 +10691,12 @@ proc tree_view_tree_to_widget_coords*(tree_view: PTreeView, tx: gint, ty: gint,
                                       wx: Pgint, wy: Pgint){.cdecl, dynlib: lib, 
     importc: "gtk_tree_view_tree_to_widget_coords".}
 proc tree_view_enable_model_drag_source*(tree_view: PTreeView, 
-    start_button_mask: TGdkModifierType, targets: PTargetEntry, n_targets: gint, 
-    actions: TGdkDragAction){.cdecl, dynlib: lib, 
+    start_button_mask: gdk2.TModifierType, targets: PTargetEntry, n_targets: gint, 
+    actions: gdk2.TDragAction){.cdecl, dynlib: lib, 
                               importc: "gtk_tree_view_enable_model_drag_source".}
 proc tree_view_enable_model_drag_dest*(tree_view: PTreeView, 
                                        targets: PTargetEntry, n_targets: gint, 
-                                       actions: TGdkDragAction){.cdecl, 
+                                       actions: gdk2.TDragAction){.cdecl, 
     dynlib: lib, importc: "gtk_tree_view_enable_model_drag_dest".}
 proc tree_view_unset_rows_drag_source*(tree_view: PTreeView){.cdecl, 
     dynlib: lib, importc: "gtk_tree_view_unset_rows_drag_source".}
@@ -10707,7 +10705,7 @@ proc tree_view_unset_rows_drag_dest*(tree_view: PTreeView){.cdecl, dynlib: lib,
 proc tree_view_set_drag_dest_row*(tree_view: PTreeView, path: PTreePath, 
                                   pos: TTreeViewDropPosition){.cdecl, 
     dynlib: lib, importc: "gtk_tree_view_set_drag_dest_row".}
-proc tree_view_create_row_drag_icon*(tree_view: PTreeView, path: PTreePath): PGdkPixmap{.
+proc tree_view_create_row_drag_icon*(tree_view: PTreeView, path: PTreePath): gdk2.PPixmap{.
     cdecl, dynlib: lib, importc: "gtk_tree_view_create_row_drag_icon".}
 proc tree_view_set_enable_search*(tree_view: PTreeView, enable_search: gboolean){.
     cdecl, dynlib: lib, importc: "gtk_tree_view_set_enable_search".}
@@ -10810,7 +10808,7 @@ proc vseparator_get_type*(): TType{.cdecl, dynlib: lib,
 proc vseparator_new*(): PVSeparator{.cdecl, dynlib: lib, 
                                      importc: "gtk_vseparator_new".}
 proc TYPE_OBJECT*(): GType = 
-  result = object_get_type()
+  result = gtk2.object_get_type()
 
 proc CHECK_CAST*(instance: Pointer, g_type: GType): PGTypeInstance = 
   result = G_TYPE_CHECK_INSTANCE_CAST(instance, g_type)
@@ -10827,20 +10825,20 @@ proc CHECK_TYPE*(instance: Pointer, g_type: GType): bool =
 proc CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool = 
   result = G_TYPE_CHECK_CLASS_TYPE(g_class, g_type)
 
-proc OBJECT*(anObject: pointer): PObject = 
-  result = cast[PObject](CHECK_CAST(anObject, TYPE_OBJECT()))
+proc `OBJECT`*(anObject: pointer): PObject = 
+  result = cast[PObject](CHECK_CAST(anObject, gtk2.TYPE_OBJECT()))
 
 proc OBJECT_CLASS*(klass: pointer): PObjectClass = 
-  result = cast[PObjectClass](CHECK_CLASS_CAST(klass, TYPE_OBJECT()))
+  result = cast[PObjectClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_OBJECT()))
 
 proc IS_OBJECT*(anObject: pointer): bool = 
-  result = CHECK_TYPE(anObject, TYPE_OBJECT())
+  result = CHECK_TYPE(anObject, gtk2.TYPE_OBJECT())
 
 proc IS_OBJECT_CLASS*(klass: pointer): bool = 
-  result = CHECK_CLASS_TYPE(klass, TYPE_OBJECT())
+  result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_OBJECT())
 
 proc OBJECT_GET_CLASS*(anObject: pointer): PObjectClass = 
-  result = cast[PObjectClass](CHECK_GET_CLASS(anObject, TYPE_OBJECT()))
+  result = cast[PObjectClass](CHECK_GET_CLASS(anObject, gtk2.TYPE_OBJECT()))
 
 proc OBJECT_TYPE*(anObject: pointer): GType = 
   result = G_TYPE_FROM_INSTANCE(anObject)
@@ -10849,16 +10847,16 @@ proc OBJECT_TYPE_NAME*(anObject: pointer): cstring =
   result = g_type_name(OBJECT_TYPE(anObject))
 
 proc OBJECT_FLAGS*(obj: pointer): guint32 = 
-  result = (OBJECT(obj)).flags
+  result = (gtk2.`OBJECT`(obj)).flags
 
 proc OBJECT_FLOATING*(obj: pointer): gboolean = 
   result = ((OBJECT_FLAGS(obj)) and cint(FLOATING)) != 0'i32
 
 proc OBJECT_SET_FLAGS*(obj: pointer, flag: guint32) = 
-  OBJECT(obj).flags = OBJECT(obj).flags or flag
+  gtk2.`OBJECT`(obj).flags = gtk2.`OBJECT`(obj).flags or flag
 
 proc OBJECT_UNSET_FLAGS*(obj: pointer, flag: guint32) = 
-  OBJECT(obj).flags = OBJECT(obj).flags and not (flag)
+  gtk2.`OBJECT`(obj).flags = gtk2.`OBJECT`(obj).flags and not (flag)
 
 proc object_data_try_key*(`string`: cstring): TGQuark = 
   result = g_quark_try_string(`string`)
@@ -10873,7 +10871,7 @@ proc CLASS_TYPE*(`class`: pointer): GType =
   result = G_TYPE_FROM_CLASS(`class`)
 
 proc TYPE_IS_OBJECT*(thetype: GType): gboolean = 
-  result = g_type_is_a(thetype, TYPE_OBJECT())
+  result = g_type_is_a(thetype, gtk2.TYPE_OBJECT())
 
 proc TYPE_IDENTIFIER*(): GType = 
   result = identifier_get_type()
@@ -11057,13 +11055,13 @@ proc WIDGET_NO_WINDOW*(wid: pointer): gboolean =
   result = ((WIDGET_FLAGS(wid)) and cint(NO_WINDOW)) != 0'i32
 
 proc WIDGET_REALIZED*(wid: pointer): gboolean = 
-  result = ((WIDGET_FLAGS(wid)) and cint(REALIZED)) != 0'i32
+  result = ((WIDGET_FLAGS(wid)) and cint(constREALIZED)) != 0'i32
 
 proc WIDGET_MAPPED*(wid: pointer): gboolean = 
   result = ((WIDGET_FLAGS(wid)) and cint(MAPPED)) != 0'i32
 
 proc WIDGET_VISIBLE*(wid: pointer): gboolean = 
-  result = ((WIDGET_FLAGS(wid)) and cint(VISIBLE)) != 0'i32
+  result = ((WIDGET_FLAGS(wid)) and cint(constVISIBLE)) != 0'i32
 
 proc WIDGET_DRAWABLE*(wid: pointer): gboolean = 
   result = (WIDGET_VISIBLE(wid)) and (WIDGET_MAPPED(wid))
@@ -11081,7 +11079,7 @@ proc WIDGET_CAN_FOCUS*(wid: pointer): gboolean =
   result = ((WIDGET_FLAGS(wid)) and cint(CAN_FOCUS)) != 0'i32
 
 proc WIDGET_HAS_FOCUS*(wid: pointer): gboolean = 
-  result = ((WIDGET_FLAGS(wid)) and cint(HAS_FOCUS)) != 0'i32
+  result = ((WIDGET_FLAGS(wid)) and cint(constHAS_FOCUS)) != 0'i32
 
 proc WIDGET_CAN_DEFAULT*(wid: pointer): gboolean = 
   result = ((WIDGET_FLAGS(wid)) and cint(CAN_DEFAULT)) != 0'i32
@@ -11301,19 +11299,19 @@ proc TYPE_WINDOW*(): GType =
   result = window_get_type()
 
 proc WINDOW*(obj: pointer): PWindow = 
-  result = cast[PWindow](CHECK_CAST(obj, TYPE_WINDOW()))
+  result = cast[PWindow](CHECK_CAST(obj, gtk2.TYPE_WINDOW()))
 
 proc WINDOW_CLASS*(klass: pointer): PWindowClass = 
-  result = cast[PWindowClass](CHECK_CLASS_CAST(klass, TYPE_WINDOW()))
+  result = cast[PWindowClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_WINDOW()))
 
 proc IS_WINDOW*(obj: pointer): bool = 
-  result = CHECK_TYPE(obj, TYPE_WINDOW())
+  result = CHECK_TYPE(obj, gtk2.TYPE_WINDOW())
 
 proc IS_WINDOW_CLASS*(klass: pointer): bool = 
-  result = CHECK_CLASS_TYPE(klass, TYPE_WINDOW())
+  result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_WINDOW())
 
 proc WINDOW_GET_CLASS*(obj: pointer): PWindowClass = 
-  result = cast[PWindowClass](CHECK_GET_CLASS(obj, TYPE_WINDOW()))
+  result = cast[PWindowClass](CHECK_GET_CLASS(obj, gtk2.TYPE_WINDOW()))
 
 proc allow_shrink*(a: var TWindow): guint = 
   result = (a.Window_flag0 and bm_TGtkWindow_allow_shrink) shr
@@ -11709,7 +11707,7 @@ proc set_in_emission*(a: var TBindingEntry, `in_emission`: guint) =
       bm_TGtkBindingEntry_in_emission)
 
 proc binding_entry_add*(binding_set: PBindingSet, keyval: guint, 
-                        modifiers: TGdkModifierType) = 
+                        modifiers: gdk2.TModifierType) = 
   binding_entry_clear(binding_set, keyval, modifiers)
 
 proc TYPE_BOX*(): GType = 
@@ -12257,7 +12255,7 @@ proc set_hide_on_activate*(a: var TMenuItemClass, `hide_on_activate`: guint) =
       bm_TGtkMenuItemClass_hide_on_activate)
 
 proc menu_item_right_justify*(menu_item: PMenuItem) = 
-  menu_item_set_right_justified(menu_item, true)
+  menu_item_set_right_justified(menu_item, system.true)
 
 proc TYPE_TOGGLE_BUTTON*(): GType = 
   result = toggle_button_get_type()
@@ -13559,8 +13557,8 @@ proc TYPE_BORDER*(): GType =
 proc STYLE_ATTACHED*(style: pointer): bool = 
   result = ((STYLE(style)).attach_count) > 0'i32
 
-proc style_apply_default_pixmap*(style: PStyle, window: PGdkWindow, 
-                                 state_type: TStateType, area: PGdkRectangle, 
+proc style_apply_default_pixmap*(style: PStyle, window: gdk2.PWindow, 
+                                 state_type: TStateType, area: gdk2.PRectangle, 
                                  x: gint, y: gint, width: gint, height: gint) = 
   style_apply_default_background(style, window, true, state_type, area, x, y, 
                                  width, height)
@@ -13825,22 +13823,22 @@ proc TYPE_ICON_SOURCE*(): GType =
   result = icon_source_get_type()
 
 proc TYPE_IMAGE*(): GType = 
-  result = image_get_type()
+  result = gtk2.image_get_type()
 
 proc IMAGE*(obj: pointer): PImage = 
-  result = cast[PImage](CHECK_CAST(obj, TYPE_IMAGE()))
+  result = cast[PImage](CHECK_CAST(obj, gtk2.TYPE_IMAGE()))
 
 proc IMAGE_CLASS*(klass: pointer): PImageClass = 
-  result = cast[PImageClass](CHECK_CLASS_CAST(klass, TYPE_IMAGE()))
+  result = cast[PImageClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_IMAGE()))
 
 proc IS_IMAGE*(obj: pointer): bool = 
-  result = CHECK_TYPE(obj, TYPE_IMAGE())
+  result = CHECK_TYPE(obj, gtk2.TYPE_IMAGE())
 
 proc IS_IMAGE_CLASS*(klass: pointer): bool = 
-  result = CHECK_CLASS_TYPE(klass, TYPE_IMAGE())
+  result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_IMAGE())
 
 proc IMAGE_GET_CLASS*(obj: pointer): PImageClass = 
-  result = cast[PImageClass](CHECK_GET_CLASS(obj, TYPE_IMAGE()))
+  result = cast[PImageClass](CHECK_GET_CLASS(obj, gtk2.TYPE_IMAGE()))
 
 proc TYPE_IMAGE_MENU_ITEM*(): GType = 
   result = image_menu_item_get_type()
@@ -14376,22 +14374,22 @@ proc OPTION_MENU_GET_CLASS*(obj: pointer): POptionMenuClass =
   result = cast[POptionMenuClass](CHECK_GET_CLASS(obj, TYPE_OPTION_MENU()))
 
 proc TYPE_PIXMAP*(): GType = 
-  result = pixmap_get_type()
+  result = gtk2.pixmap_get_type()
 
 proc PIXMAP*(obj: pointer): PPixmap = 
-  result = cast[PPixmap](CHECK_CAST(obj, TYPE_PIXMAP()))
+  result = cast[PPixmap](CHECK_CAST(obj, gtk2.TYPE_PIXMAP()))
 
 proc PIXMAP_CLASS*(klass: pointer): PPixmapClass = 
-  result = cast[PPixmapClass](CHECK_CLASS_CAST(klass, TYPE_PIXMAP()))
+  result = cast[PPixmapClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_PIXMAP()))
 
 proc IS_PIXMAP*(obj: pointer): bool = 
-  result = CHECK_TYPE(obj, TYPE_PIXMAP())
+  result = CHECK_TYPE(obj, gtk2.TYPE_PIXMAP())
 
 proc IS_PIXMAP_CLASS*(klass: pointer): bool = 
-  result = CHECK_CLASS_TYPE(klass, TYPE_PIXMAP())
+  result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_PIXMAP())
 
 proc PIXMAP_GET_CLASS*(obj: pointer): PPixmapClass = 
-  result = cast[PPixmapClass](CHECK_GET_CLASS(obj, TYPE_PIXMAP()))
+  result = cast[PPixmapClass](CHECK_GET_CLASS(obj, gtk2.TYPE_PIXMAP()))
 
 proc build_insensitive*(a: var TPixmap): guint = 
   result = (a.Pixmapflag0 and bm_TGtkPixmap_build_insensitive) shr
@@ -14977,22 +14975,22 @@ proc set_has_resize_grip*(a: var TStatusbar, `has_resize_grip`: guint) =
       bm_TGtkStatusbar_has_resize_grip)
 
 proc TYPE_TABLE*(): GType = 
-  result = table_get_type()
+  result = gtk2.table_get_type()
 
 proc TABLE*(obj: pointer): PTable = 
-  result = cast[PTable](CHECK_CAST(obj, TYPE_TABLE()))
+  result = cast[PTable](CHECK_CAST(obj, gtk2.TYPE_TABLE()))
 
 proc TABLE_CLASS*(klass: pointer): PTableClass = 
-  result = cast[PTableClass](CHECK_CLASS_CAST(klass, TYPE_TABLE()))
+  result = cast[PTableClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_TABLE()))
 
 proc IS_TABLE*(obj: pointer): bool = 
-  result = CHECK_TYPE(obj, TYPE_TABLE())
+  result = CHECK_TYPE(obj, gtk2.TYPE_TABLE())
 
 proc IS_TABLE_CLASS*(klass: pointer): bool = 
-  result = CHECK_CLASS_TYPE(klass, TYPE_TABLE())
+  result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_TABLE())
 
 proc TABLE_GET_CLASS*(obj: pointer): PTableClass = 
-  result = cast[PTableClass](CHECK_GET_CLASS(obj, TYPE_TABLE()))
+  result = cast[PTableClass](CHECK_GET_CLASS(obj, gtk2.TYPE_TABLE()))
 
 proc homogeneous*(a: var TTable): guint = 
   result = (a.Tableflag0 and bm_TGtkTable_homogeneous) shr
@@ -15130,22 +15128,22 @@ proc set_torn_off*(a: var TTearoffMenuItem, `torn_off`: guint) =
       bm_TGtkTearoffMenuItem_torn_off)
 
 proc TYPE_TEXT*(): GType = 
-  result = text_get_type()
+  result = gtk2.text_get_type()
 
 proc TEXT*(obj: pointer): PText = 
-  result = cast[PText](CHECK_CAST(obj, TYPE_TEXT()))
+  result = cast[PText](CHECK_CAST(obj, gtk2.TYPE_TEXT()))
 
 proc TEXT_CLASS*(klass: pointer): PTextClass = 
-  result = cast[PTextClass](CHECK_CLASS_CAST(klass, TYPE_TEXT()))
+  result = cast[PTextClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_TEXT()))
 
 proc IS_TEXT*(obj: pointer): bool = 
-  result = CHECK_TYPE(obj, TYPE_TEXT())
+  result = CHECK_TYPE(obj, gtk2.TYPE_TEXT())
 
 proc IS_TEXT_CLASS*(klass: pointer): bool = 
-  result = CHECK_CLASS_TYPE(klass, TYPE_TEXT())
+  result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_TEXT())
 
 proc TEXT_GET_CLASS*(obj: pointer): PTextClass = 
-  result = cast[PTextClass](CHECK_GET_CLASS(obj, TYPE_TEXT()))
+  result = cast[PTextClass](CHECK_GET_CLASS(obj, gtk2.TYPE_TEXT()))
 
 proc line_wrap*(a: PText): guint = 
   result = (a.Textflag0 and bm_TGtkText_line_wrap) shr bp_TGtkText_line_wrap
@@ -16542,7 +16540,7 @@ const
   ARG_READWRITE* = ARG_READABLE or ARG_WRITABLE
 
 proc binding_entry_add_signal*(binding_set: PBindingSet, keyval: guint, 
-                               modifiers: TGdkModifierType, 
+                               modifiers: gdk2.TModifierType, 
                                signal_name: cstring, n_args: guint){.varargs, 
     importc: "gtk_binding_entry_add_signal", cdecl, dynlib: lib.}
 proc clist_new_with_titles*(columns: gint): PCList{.varargs, cdecl, 
@@ -16651,7 +16649,7 @@ proc widget_queue_clear*(widget: PWidget){.importc: "gtk_widget_queue_clear",
 proc widget_queue_clear_area*(widget: PWidget, x: gint, y: gint, width: gint, 
                               height: gint){.cdecl, 
     importc: "gtk_widget_queue_clear_area", dynlib: lib.}
-proc widget_draw*(widget: PWidget, area: PGdkRectangle){.cdecl, 
+proc widget_draw*(widget: PWidget, area: gdk2.PRectangle){.cdecl, 
     importc: "gtk_widget_draw", dynlib: lib.}
 proc widget_style_get_valist*(widget: PWidget, first_property_name: cstring){.
     varargs, cdecl, importc: "gtk_widget_style_get_valist", dynlib: lib.}
@@ -16876,6 +16874,7 @@ proc file_chooser_list_shortcut_folder_uris*(chooser: PFileChooser): PGSList{.
 proc file_chooser_set_do_overwrite_confirmation*(chooser: PFileChooser, 
     do_overwrite_confirmation: gboolean){.cdecl, dynlib: lib, 
     importc: "gtk_file_chooser_set_do_overwrite_confirmation".}
+
 proc nimrod_init*() = 
   var 
     cmdLine{.importc: "cmdLine".}: array[0..255, cstring]
diff --git a/lib/newwrap/libcurl.nim b/lib/newwrap/libcurl.nim
index 6dc61f112..38e76a033 100755
--- a/lib/newwrap/libcurl.nim
+++ b/lib/newwrap/libcurl.nim
@@ -67,8 +67,8 @@ type
   PSHoption* = ptr TSHoption
   Pversion* = ptr Tversion
   Pfd_set* = pointer
-  P* = ptr T
-  T* = pointer
+  PCurl* = ptr TCurl
+  TCurl* = pointer
   Thttppost*{.final, pure.} = object 
     next*: Phttppost
     name*: cstring
@@ -84,8 +84,8 @@ type
     showfilename*: cstring
 
   Tprogress_callback* = proc (clientp: pointer, dltotal: float64, 
-                              dlnow: float64, ultotal: float64, ulnow: float64): int32{.
-      cdecl.}
+                              dlnow: float64, ultotal: float64, 
+                              ulnow: float64): int32 {.cdecl.}
   Twrite_callback* = proc (buffer: cstring, size: int, nitems: int, 
                            outstream: pointer): int{.cdecl.}
   Tread_callback* = proc (buffer: cstring, size: int, nitems: int, 
@@ -96,7 +96,7 @@ type
     IOE_OK, IOE_UNKNOWNCMD, IOE_FAILRESTART, IOE_LAST
   Tiocmd* = enum 
     IOCMD_NOP, IOCMD_RESTARTREAD, IOCMD_LAST
-  Tioctl_callback* = proc (handle: P, cmd: int32, clientp: pointer): Tioerr{.
+  Tioctl_callback* = proc (handle: PCurl, cmd: int32, clientp: pointer): Tioerr{.
       cdecl.}
   Tmalloc_callback* = proc (size: int): pointer{.cdecl.}
   Tfree_callback* = proc (p: pointer){.cdecl.}
@@ -106,7 +106,7 @@ type
   Tinfotype* = enum 
     INFO_TEXT = 0, INFO_HEADER_IN, INFO_HEADER_OUT, INFO_DATA_IN, INFO_DATA_OUT, 
     INFO_SSL_DATA_IN, INFO_SSL_DATA_OUT, INFO_END
-  Tdebug_callback* = proc (handle: P, theType: Tinfotype, data: cstring, 
+  Tdebug_callback* = proc (handle: PCurl, theType: Tinfotype, data: cstring, 
                            size: int, userptr: pointer): int32{.cdecl.}
   Tcode* = enum 
     E_OK = 0, E_UNSUPPORTED_PROTOCOL, E_FAILED_INIT, E_URL_MALFORMAT, 
@@ -134,7 +134,7 @@ type
     E_TFTP_ILLEGAL, E_TFTP_UNKNOWNID, E_TFTP_EXISTS, E_TFTP_NOSUCHUSER, 
     E_CONV_FAILED, E_CONV_REQD, LAST
   Tconv_callback* = proc (buffer: cstring, len: int): Tcode{.cdecl.}
-  Tssl_ctx_callback* = proc (: P, ssl_ctx, userptr: pointer): Tcode{.cdecl.}
+  Tssl_ctx_callback* = proc (curl: PCurl, ssl_ctx, userptr: pointer): Tcode{.cdecl.}
   Tproxytype* = enum 
     PROXY_HTTP = 0, PROXY_SOCKS4 = 4, PROXY_SOCKS5 = 5
   Tftpssl* = enum 
@@ -269,9 +269,10 @@ type
   Tlock_access* = enum 
     LOCK_ACCESS_NONE = 0, LOCK_ACCESS_SHARED = 1, LOCK_ACCESS_SINGLE = 2, 
     LOCK_ACCESS_LAST
-  Tlock_function* = proc (handle: P, data: Tlock_data, locktype: Tlock_access, 
+  Tlock_function* = proc (handle: PCurl, data: Tlock_data,
+                          locktype: Tlock_access, 
                           userptr: pointer){.cdecl.}
-  Tunlock_function* = proc (handle: P, data: Tlock_data, userptr: pointer){.
+  Tunlock_function* = proc (handle: PCurl, data: Tlock_data, userptr: pointer){.
       cdecl.}
   TSH* = pointer
   TSHcode* = enum 
@@ -305,14 +306,14 @@ type
     MSG_NONE, MSG_DONE, MSG_LAST
   TMsg*{.pure, final.} = object 
     msg*: TMSGEnum
-    easy_handle*: P
+    easy_handle*: PCurl
     whatever*: Pointer        #data : record
                               #      case longint of
                               #        0 : ( whatever : pointer );
                               #        1 : ( result : CURLcode );
                               #    end;
   
-  Tsocket_callback* = proc (easy: P, s: Tsocket, what: int32, 
+  Tsocket_callback* = proc (easy: PCurl, s: Tsocket, what: int32, 
                             userp, socketp: pointer): int32{.cdecl.}
   TMoption* = enum 
     MOPT_SOCKETDATA = 10000 + 2, MOPT_LASTENTRY = 10000 + 3, 
@@ -419,11 +420,11 @@ proc formfree*(form: Phttppost){.cdecl, dynlib: libname,
 proc getenv*(variable: cstring): cstring{.cdecl, dynlib: libname, 
     importc: "curl_getenv".}
 proc version*(): cstring{.cdecl, dynlib: libname, importc: "curl_version".}
-proc easy_escape*(handle: P, str: cstring, len: int32): cstring{.cdecl, 
+proc easy_escape*(handle: PCurl, str: cstring, len: int32): cstring{.cdecl, 
     dynlib: libname, importc: "curl_easy_escape".}
 proc escape*(str: cstring, len: int32): cstring{.cdecl, dynlib: libname, 
     importc: "curl_escape".}
-proc easy_unescape*(handle: P, str: cstring, len: int32, outlength: var int32): cstring{.
+proc easy_unescape*(handle: PCurl, str: cstring, len: int32, outlength: var int32): cstring{.
     cdecl, dynlib: libname, importc: "curl_easy_unescape".}
 proc unescape*(str: cstring, len: int32): cstring{.cdecl, dynlib: libname, 
     importc: "curl_unescape".}
@@ -435,7 +436,7 @@ proc global_init_mem*(flags: int32, m: Tmalloc_callback, f: Tfree_callback,
                       c: Tcalloc_callback): Tcode{.cdecl, dynlib: libname, 
     importc: "curl_global_init_mem".}
 proc global_cleanup*(){.cdecl, dynlib: libname, importc: "curl_global_cleanup".}
-proc slist_append*(slist: Pslist, P: cstring): Pslist{.cdecl, dynlib: libname, 
+proc slist_append*(slist: Pslist, p: cstring): Pslist{.cdecl, dynlib: libname, 
     importc: "curl_slist_append".}
 proc slist_free_all*(para1: Pslist){.cdecl, dynlib: libname, 
                                      importc: "curl_slist_free_all".}
@@ -452,21 +453,21 @@ proc easy_strerror*(para1: Tcode): cstring{.cdecl, dynlib: libname,
     importc: "curl_easy_strerror".}
 proc share_strerror*(para1: TSHcode): cstring{.cdecl, dynlib: libname, 
     importc: "curl_share_strerror".}
-proc easy_init*(): P{.cdecl, dynlib: libname, importc: "curl_easy_init".}
-proc easy_setopt*(: P, option: Toption): Tcode{.cdecl, varargs, dynlib: libname, 
+proc easy_init*(): PCurl{.cdecl, dynlib: libname, importc: "curl_easy_init".}
+proc easy_setopt*(curl: PCurl, option: Toption): Tcode{.cdecl, varargs, dynlib: libname, 
     importc: "curl_easy_setopt".}
-proc easy_perform*(: P): Tcode{.cdecl, dynlib: libname, 
+proc easy_perform*(curl: PCurl): Tcode{.cdecl, dynlib: libname, 
                                 importc: "curl_easy_perform".}
-proc easy_cleanup*(: P){.cdecl, dynlib: libname, importc: "curl_easy_cleanup".}
-proc easy_getinfo*(: P, info: TINFO): Tcode{.cdecl, varargs, dynlib: libname, 
+proc easy_cleanup*(curl: PCurl){.cdecl, dynlib: libname, importc: "curl_easy_cleanup".}
+proc easy_getinfo*(curl: PCurl, info: TINFO): Tcode{.cdecl, varargs, dynlib: libname, 
     importc: "curl_easy_getinfo".}
-proc easy_duphandle*(: P): P{.cdecl, dynlib: libname, 
+proc easy_duphandle*(curl: PCurl): PCurl{.cdecl, dynlib: libname, 
                               importc: "curl_easy_duphandle".}
-proc easy_reset*(: P){.cdecl, dynlib: libname, importc: "curl_easy_reset".}
+proc easy_reset*(curl: PCurl){.cdecl, dynlib: libname, importc: "curl_easy_reset".}
 proc multi_init*(): PM{.cdecl, dynlib: libname, importc: "curl_multi_init".}
-proc multi_add_handle*(multi_handle: PM, handle: P): TMcode{.cdecl, 
+proc multi_add_handle*(multi_handle: PM, handle: PCurl): TMcode{.cdecl, 
     dynlib: libname, importc: "curl_multi_add_handle".}
-proc multi_remove_handle*(multi_handle: PM, handle: P): TMcode{.cdecl, 
+proc multi_remove_handle*(multi_handle: PM, handle: PCurl): TMcode{.cdecl, 
     dynlib: libname, importc: "curl_multi_remove_handle".}
 proc multi_fdset*(multi_handle: PM, read_fd_set: Pfd_set, write_fd_set: Pfd_set, 
                   exc_fd_set: Pfd_set, max_fd: var int32): TMcode{.cdecl, 
@@ -488,4 +489,4 @@ proc multi_timeout*(multi_handle: PM, milliseconds: var int32): TMcode{.cdecl,
 proc multi_setopt*(multi_handle: PM, option: TMoption): TMcode{.cdecl, varargs, 
     dynlib: libname, importc: "curl_multi_setopt".}
 proc multi_assign*(multi_handle: PM, sockfd: Tsocket, sockp: pointer): TMcode{.
-    cdecl, dynlib: libname, importc: "curl_multi_assign".}
\ No newline at end of file
+    cdecl, dynlib: libname, importc: "curl_multi_assign".}
diff --git a/lib/newwrap/lua/lauxlib.nim b/lib/newwrap/lua/lauxlib.nim
index 13a473687..f96e8ee4f 100755
--- a/lib/newwrap/lua/lauxlib.nim
+++ b/lib/newwrap/lua/lauxlib.nim
@@ -24,89 +24,89 @@
 import 
   lua
 
-proc lua_pushstring*(L: Plua_State, s: string)
+proc pushstring*(L: PState, s: string)
   # compatibilty macros
-proc getn*(L: Plua_State, n: int): int
+proc getn*(L: PState, n: int): int
   # calls lua_objlen
-proc setn*(L: Plua_State, t, n: int)
+proc setn*(L: PState, t, n: int)
   # does nothing!
 type 
   Treg*{.final.} = object 
     name*: cstring
-    func*: lua_CFunction
+    func*: CFunction
 
   Preg* = ptr Treg
 
-proc openlib*(L: Plua_State, libname: cstring, lr: Preg, nup: int){.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_openlib".}
-proc register*(L: Plua_State, libname: cstring, lr: Preg){.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_register".}
-proc getmetafield*(L: Plua_State, obj: int, e: cstring): int{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_getmetafield".}
-proc callmeta*(L: Plua_State, obj: int, e: cstring): int{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_callmeta".}
-proc typerror*(L: Plua_State, narg: int, tname: cstring): int{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_typerror".}
-proc argerror*(L: Plua_State, numarg: int, extramsg: cstring): int{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_argerror".}
-proc checklstring*(L: Plua_State, numArg: int, l_: Psize_t): cstring{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_checklstring".}
-proc optlstring*(L: Plua_State, numArg: int, def: cstring, l_: Psize_t): cstring{.
-    cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_optlstring".}
-proc checknumber*(L: Plua_State, numArg: int): lua_Number{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_checknumber".}
-proc optnumber*(L: Plua_State, nArg: int, def: lua_Number): lua_Number{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_optnumber".}
-proc checkinteger*(L: Plua_State, numArg: int): lua_Integer{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_checkinteger".}
-proc optinteger*(L: Plua_State, nArg: int, def: lua_Integer): lua_Integer{.
-    cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_optinteger".}
-proc checkstack*(L: Plua_State, sz: int, msg: cstring){.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_checkstack".}
-proc checktype*(L: Plua_State, narg, t: int){.cdecl, dynlib: LUA_LIB_NAME, 
+proc openlib*(L: PState, libname: cstring, lr: Preg, nup: int){.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_openlib".}
+proc register*(L: PState, libname: cstring, lr: Preg){.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_register".}
+proc getmetafield*(L: PState, obj: int, e: cstring): int{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_getmetafield".}
+proc callmeta*(L: PState, obj: int, e: cstring): int{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_callmeta".}
+proc typerror*(L: PState, narg: int, tname: cstring): int{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_typerror".}
+proc argerror*(L: PState, numarg: int, extramsg: cstring): int{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_argerror".}
+proc checklstring*(L: PState, numArg: int, l_: Psize_t): cstring{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_checklstring".}
+proc optlstring*(L: PState, numArg: int, def: cstring, l_: Psize_t): cstring{.
+    cdecl, dynlib: LIB_NAME, importc: "luaL_optlstring".}
+proc checknumber*(L: PState, numArg: int): lua_Number{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_checknumber".}
+proc optnumber*(L: PState, nArg: int, def: lua_Number): lua_Number{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_optnumber".}
+proc checkinteger*(L: PState, numArg: int): lua_Integer{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_checkinteger".}
+proc optinteger*(L: PState, nArg: int, def: lua_Integer): lua_Integer{.
+    cdecl, dynlib: LIB_NAME, importc: "luaL_optinteger".}
+proc checkstack*(L: PState, sz: int, msg: cstring){.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_checkstack".}
+proc checktype*(L: PState, narg, t: int){.cdecl, dynlib: LIB_NAME, 
     importc: "luaL_checktype".}
-proc checkany*(L: Plua_State, narg: int){.cdecl, dynlib: LUA_LIB_NAME, 
+proc checkany*(L: PState, narg: int){.cdecl, dynlib: LIB_NAME, 
     importc: "luaL_checkany".}
-proc newmetatable*(L: Plua_State, tname: cstring): int{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_newmetatable".}
-proc checkudata*(L: Plua_State, ud: int, tname: cstring): Pointer{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_checkudata".}
-proc where*(L: Plua_State, lvl: int){.cdecl, dynlib: LUA_LIB_NAME, 
+proc newmetatable*(L: PState, tname: cstring): int{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_newmetatable".}
+proc checkudata*(L: PState, ud: int, tname: cstring): Pointer{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_checkudata".}
+proc where*(L: PState, lvl: int){.cdecl, dynlib: LIB_NAME, 
                                       importc: "luaL_where".}
-proc error*(L: Plua_State, fmt: cstring): int{.cdecl, varargs, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_error".}
-proc checkoption*(L: Plua_State, narg: int, def: cstring, lst: cstringArray): int{.
-    cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_checkoption".}
-proc ref*(L: Plua_State, t: int): int{.cdecl, dynlib: LUA_LIB_NAME, 
+proc error*(L: PState, fmt: cstring): int{.cdecl, varargs, 
+    dynlib: LIB_NAME, importc: "luaL_error".}
+proc checkoption*(L: PState, narg: int, def: cstring, lst: cstringArray): int{.
+    cdecl, dynlib: LIB_NAME, importc: "luaL_checkoption".}
+proc ref*(L: PState, t: int): int{.cdecl, dynlib: LIB_NAME, 
                                        importc: "luaL_ref".}
-proc unref*(L: Plua_State, t, theref: int){.cdecl, dynlib: LUA_LIB_NAME, 
+proc unref*(L: PState, t, theref: int){.cdecl, dynlib: LIB_NAME, 
     importc: "luaL_unref".}
-proc loadfile*(L: Plua_State, filename: cstring): int{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_loadfile".}
-proc loadbuffer*(L: Plua_State, buff: cstring, size: size_t, name: cstring): int{.
-    cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_loadbuffer".}
-proc loadstring*(L: Plua_State, s: cstring): int{.cdecl, dynlib: LUA_LIB_NAME, 
+proc loadfile*(L: PState, filename: cstring): int{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_loadfile".}
+proc loadbuffer*(L: PState, buff: cstring, size: size_t, name: cstring): int{.
+    cdecl, dynlib: LIB_NAME, importc: "luaL_loadbuffer".}
+proc loadstring*(L: PState, s: cstring): int{.cdecl, dynlib: LIB_NAME, 
     importc: "luaL_loadstring".}
-proc newstate*(): Plua_State{.cdecl, dynlib: LUA_LIB_NAME, 
+proc newstate*(): PState{.cdecl, dynlib: LIB_NAME, 
                               importc: "luaL_newstate".}
-proc lua_open*(): Plua_State
+proc lua_open*(): PState
   # compatibility; moved from unit lua to lauxlib because it needs luaL_newstate
   #
   #** ===============================================================
   #** some useful macros
   #** ===============================================================
   #
-proc argcheck*(L: Plua_State, cond: bool, numarg: int, extramsg: cstring)
-proc checkstring*(L: Plua_State, n: int): cstring
-proc optstring*(L: Plua_State, n: int, d: cstring): cstring
-proc checkint*(L: Plua_State, n: int): int
-proc checklong*(L: Plua_State, n: int): int32
-proc optint*(L: Plua_State, n: int, d: float64): int
-proc optlong*(L: Plua_State, n: int, d: float64): int32
-proc typename*(L: Plua_State, i: int): cstring
-proc lua_dofile*(L: Plua_State, filename: cstring): int
-proc lua_dostring*(L: Plua_State, str: cstring): int
-proc lua_Lgetmetatable*(L: Plua_State, tname: cstring)
+proc argcheck*(L: PState, cond: bool, numarg: int, extramsg: cstring)
+proc checkstring*(L: PState, n: int): cstring
+proc optstring*(L: PState, n: int, d: cstring): cstring
+proc checkint*(L: PState, n: int): int
+proc checklong*(L: PState, n: int): int32
+proc optint*(L: PState, n: int, d: float64): int
+proc optlong*(L: PState, n: int, d: float64): int32
+proc typename*(L: PState, i: int): cstring
+proc lua_dofile*(L: PState, filename: cstring): int
+proc lua_dostring*(L: PState, str: cstring): int
+proc lua_Lgetmetatable*(L: PState, tname: cstring)
   # not translated:
   # #define luaL_opt(L,f,n,d)	(lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
   #
@@ -121,7 +121,7 @@ type
   Buffer*{.final.} = object 
     p*: cstring               # current position in buffer 
     lvl*: int                 # number of strings in the stack (level) 
-    L*: Plua_State
+    L*: PState
     buffer*: array[0..BUFFERSIZE - 1, Char] # warning: see note above about LUAL_BUFFERSIZE
   
   PBuffer* = ptr Buffer
@@ -132,82 +132,82 @@ proc addchar*(B: PBuffer, c: Char)
 proc putchar*(B: PBuffer, c: Char)
   # warning: see note above about LUAL_BUFFERSIZE
 proc addsize*(B: PBuffer, n: int)
-proc buffinit*(L: Plua_State, B: PBuffer){.cdecl, dynlib: LUA_LIB_NAME, 
+proc buffinit*(L: PState, B: PBuffer){.cdecl, dynlib: LIB_NAME, 
     importc: "luaL_buffinit".}
-proc prepbuffer*(B: PBuffer): cstring{.cdecl, dynlib: LUA_LIB_NAME, 
+proc prepbuffer*(B: PBuffer): cstring{.cdecl, dynlib: LIB_NAME, 
                                        importc: "luaL_prepbuffer".}
 proc addlstring*(B: PBuffer, s: cstring, L: size_t){.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_addlstring".}
-proc addstring*(B: PBuffer, s: cstring){.cdecl, dynlib: LUA_LIB_NAME, 
+    dynlib: LIB_NAME, importc: "luaL_addlstring".}
+proc addstring*(B: PBuffer, s: cstring){.cdecl, dynlib: LIB_NAME, 
     importc: "luaL_addstring".}
-proc addvalue*(B: PBuffer){.cdecl, dynlib: LUA_LIB_NAME, 
+proc addvalue*(B: PBuffer){.cdecl, dynlib: LIB_NAME, 
                             importc: "luaL_addvalue".}
-proc pushresult*(B: PBuffer){.cdecl, dynlib: LUA_LIB_NAME, 
+proc pushresult*(B: PBuffer){.cdecl, dynlib: LIB_NAME, 
                               importc: "luaL_pushresult".}
-proc gsub*(L: Plua_State, s, p, r: cstring): cstring{.cdecl, 
-    dynlib: LUA_LIB_NAME, importc: "luaL_gsub".}
-proc findtable*(L: Plua_State, idx: int, fname: cstring, szhint: int): cstring{.
-    cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_findtable".}
+proc gsub*(L: PState, s, p, r: cstring): cstring{.cdecl, 
+    dynlib: LIB_NAME, importc: "luaL_gsub".}
+proc findtable*(L: PState, idx: int, fname: cstring, szhint: int): cstring{.
+    cdecl, dynlib: LIB_NAME, importc: "luaL_findtable".}
   # compatibility with ref system 
   # pre-defined references 
 const 
   LUA_NOREF* = - 2
   LUA_REFNIL* = - 1
 
-proc lua_unref*(L: Plua_State, theref: int)
-proc lua_getref*(L: Plua_State, theref: int)
+proc lua_unref*(L: PState, theref: int)
+proc lua_getref*(L: PState, theref: int)
   #
   #** Compatibility macros and functions
   #
 # implementation
 
-proc lua_pushstring(L: Plua_State, s: string) = 
+proc lua_pushstring(L: PState, s: string) = 
   lua_pushlstring(L, cstring(s), len(s))
 
-proc getn(L: Plua_State, n: int): int = 
+proc getn(L: PState, n: int): int = 
   Result = lua_objlen(L, n)
 
-proc setn(L: Plua_State, t, n: int) = 
+proc setn(L: PState, t, n: int) = 
   # does nothing as this operation is deprecated
   nil
 
-proc lua_open(): Plua_State = 
+proc lua_open(): PState = 
   Result = newstate()
 
-proc typename(L: Plua_State, i: int): cstring = 
+proc typename(L: PState, i: int): cstring = 
   Result = lua_typename(L, lua_type(L, i))
 
-proc lua_dofile(L: Plua_State, filename: cstring): int = 
+proc lua_dofile(L: PState, filename: cstring): int = 
   Result = loadfile(L, filename)
   if Result == 0: Result = lua_pcall(L, 0, LUA_MULTRET, 0)
   
-proc lua_dostring(L: Plua_State, str: cstring): int = 
+proc lua_dostring(L: PState, str: cstring): int = 
   Result = loadstring(L, str)
   if Result == 0: Result = lua_pcall(L, 0, LUA_MULTRET, 0)
   
-proc lua_Lgetmetatable(L: Plua_State, tname: cstring) = 
+proc lua_Lgetmetatable(L: PState, tname: cstring) = 
   lua_getfield(L, LUA_REGISTRYINDEX, tname)
 
-proc argcheck(L: Plua_State, cond: bool, numarg: int, extramsg: cstring) = 
+proc argcheck(L: PState, cond: bool, numarg: int, extramsg: cstring) = 
   if not cond: 
     discard argerror(L, numarg, extramsg)
 
-proc checkstring(L: Plua_State, n: int): cstring = 
+proc checkstring(L: PState, n: int): cstring = 
   Result = checklstring(L, n, nil)
 
-proc optstring(L: Plua_State, n: int, d: cstring): cstring = 
+proc optstring(L: PState, n: int, d: cstring): cstring = 
   Result = optlstring(L, n, d, nil)
 
-proc checkint(L: Plua_State, n: int): int = 
+proc checkint(L: PState, n: int): int = 
   Result = toInt(checknumber(L, n))
 
-proc checklong(L: Plua_State, n: int): int32 = 
+proc checklong(L: PState, n: int): int32 = 
   Result = int32(ToInt(checknumber(L, n)))
 
-proc optint(L: Plua_State, n: int, d: float64): int = 
+proc optint(L: PState, n: int, d: float64): int = 
   Result = int(ToInt(optnumber(L, n, d)))
 
-proc optlong(L: Plua_State, n: int, d: float64): int32 = 
+proc optlong(L: PState, n: int, d: float64): int32 = 
   Result = int32(ToInt(optnumber(L, n, d)))
 
 proc addchar(B: PBuffer, c: Char) = 
@@ -222,8 +222,8 @@ proc putchar(B: PBuffer, c: Char) =
 proc addsize(B: PBuffer, n: int) = 
   B.p = cast[cstring](cast[int](B.p) + n)
 
-proc lua_unref(L: Plua_State, theref: int) = 
+proc lua_unref(L: PState, theref: int) = 
   unref(L, LUA_REGISTRYINDEX, theref)
 
-proc lua_getref(L: Plua_State, theref: int) = 
+proc lua_getref(L: PState, theref: int) = 
   lua_rawgeti(L, LUA_REGISTRYINDEX, theref)
diff --git a/lib/newwrap/lua/lua.nim b/lib/newwrap/lua/lua.nim
index b702e381c..449be5cda 100755
--- a/lib/newwrap/lua/lua.nim
+++ b/lib/newwrap/lua/lua.nim
@@ -47,9 +47,7 @@ else:
   const 
     NAME* = "lua(|5.2|5.1|5.0).dll"
     LIB_NAME* = "lua(|5.2|5.1|5.0).dll"
-type 
-  size_t* = int
-  Psize_t* = ptr size_t
+
 
 const 
   VERSION* = "Lua 5.1"
@@ -67,7 +65,7 @@ const
 
 proc upvalueindex*(I: int): int
 const                         # thread status; 0 is OK 
-  YIELD_* = 1
+  constYIELD* = 1
   ERRRUN* = 2
   ERRSYNTAX* = 3
   ERRMEM* = 4
@@ -82,9 +80,9 @@ type
 #
 
 type 
-  Reader* = proc (L: PState, ud: Pointer, sz: Psize_t): cstring{.cdecl.}
-  Writer* = proc (L: PState, p: Pointer, sz: size_t, ud: Pointer): int{.cdecl.}
-  Alloc* = proc (ud, theptr: Pointer, osize, nsize: size_t){.cdecl.}
+  Reader* = proc (L: PState, ud: Pointer, sz: ptr int): cstring{.cdecl.}
+  Writer* = proc (L: PState, p: Pointer, sz: int, ud: Pointer): int{.cdecl.}
+  Alloc* = proc (ud, theptr: Pointer, osize, nsize: int){.cdecl.}
 
 const 
   TNONE* = - 1
@@ -129,7 +127,7 @@ proc iscfunction*(L: PState, idx: int): cint{.cdecl, dynlib: NAME,
     importc: "lua_iscfunction".}
 proc isuserdata*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, 
     importc: "lua_isuserdata".}
-proc type*(L: PState, idx: int): int{.cdecl, dynlib: NAME, importc: "lua_type".}
+proc luatype*(L: PState, idx: int): int{.cdecl, dynlib: NAME, importc: "lua_type".}
 proc typename*(L: PState, tp: int): cstring{.cdecl, dynlib: NAME, 
     importc: "lua_typename".}
 proc equal*(L: PState, idx1, idx2: int): cint{.cdecl, dynlib: NAME, 
@@ -144,9 +142,9 @@ proc tointeger*(L: PState, idx: int): Integer{.cdecl, dynlib: NAME,
     importc: "lua_tointeger".}
 proc toboolean*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, 
     importc: "lua_toboolean".}
-proc tolstring*(L: PState, idx: int, length: Psize_t): cstring{.cdecl, 
+proc tolstring*(L: PState, idx: int, length: ptr int): cstring{.cdecl, 
     dynlib: NAME, importc: "lua_tolstring".}
-proc objlen*(L: PState, idx: int): size_t{.cdecl, dynlib: NAME, 
+proc objlen*(L: PState, idx: int): int{.cdecl, dynlib: NAME, 
     importc: "lua_objlen".}
 proc tocfunction*(L: PState, idx: int): CFunction{.cdecl, dynlib: NAME, 
     importc: "lua_tocfunction".}
@@ -161,7 +159,7 @@ proc pushnumber*(L: PState, n: Number){.cdecl, dynlib: NAME,
                                         importc: "lua_pushnumber".}
 proc pushinteger*(L: PState, n: Integer){.cdecl, dynlib: NAME, 
     importc: "lua_pushinteger".}
-proc pushlstring*(L: PState, s: cstring, l_: size_t){.cdecl, dynlib: NAME, 
+proc pushlstring*(L: PState, s: cstring, l_: int){.cdecl, dynlib: NAME, 
     importc: "lua_pushlstring".}
 proc pushstring*(L: PState, s: cstring){.cdecl, dynlib: NAME, 
     importc: "lua_pushstring".}
@@ -185,7 +183,7 @@ proc rawgeti*(L: PState, idx, n: int){.cdecl, dynlib: NAME,
                                        importc: "lua_rawgeti".}
 proc createtable*(L: PState, narr, nrec: int){.cdecl, dynlib: NAME, 
     importc: "lua_createtable".}
-proc newuserdata*(L: PState, sz: size_t): Pointer{.cdecl, dynlib: NAME, 
+proc newuserdata*(L: PState, sz: int): Pointer{.cdecl, dynlib: NAME, 
     importc: "lua_newuserdata".}
 proc getmetatable*(L: PState, objindex: int): int{.cdecl, dynlib: NAME, 
     importc: "lua_getmetatable".}
@@ -211,7 +209,7 @@ proc load*(L: PState, reader: Reader, dt: Pointer, chunkname: cstring): int{.
     cdecl, dynlib: NAME, importc: "lua_load".}
 proc dump*(L: PState, writer: Writer, data: Pointer): int{.cdecl, dynlib: NAME, 
     importc: "lua_dump".}
-proc yield*(L: PState, nresults: int): int{.cdecl, dynlib: NAME, 
+proc luayield*(L: PState, nresults: int): int{.cdecl, dynlib: NAME, 
     importc: "lua_yield".}
 proc resume*(L: PState, narg: int): int{.cdecl, dynlib: NAME, 
     importc: "lua_resume".}
@@ -249,7 +247,7 @@ proc pop*(L: PState, n: int)
 proc newtable*(L: Pstate)
 proc register*(L: PState, n: cstring, f: CFunction)
 proc pushcfunction*(L: PState, f: CFunction)
-proc strlen*(L: Pstate, i: int): size_t
+proc strlen*(L: Pstate, i: int): int
 proc isfunction*(L: PState, n: int): bool
 proc istable*(L: PState, n: int): bool
 proc islightuserdata*(L: PState, n: int): bool
@@ -295,7 +293,7 @@ const
   IDSIZE* = 60
 
 type 
-  Debug*{.final.} = object    # activation record 
+  TDebug*{.final.} = object    # activation record 
     event*: int
     name*: cstring            # (n) 
     namewhat*: cstring        # (n) `global', `local', `field', `method' 
@@ -309,7 +307,7 @@ type
                                            # private part 
     i_ci*: int                # active function 
   
-  PDebug* = ptr Debug
+  PDebug* = ptr TDebug
   Hook* = proc (L: PState, ar: PDebug){.cdecl.}
 
 #
@@ -355,32 +353,32 @@ proc register(L: PState, n: cstring, f: CFunction) =
 proc pushcfunction(L: PState, f: CFunction) = 
   pushcclosure(L, f, 0)
 
-proc strlen(L: PState, i: int): size_t = 
+proc strlen(L: PState, i: int): int = 
   Result = objlen(L, i)
 
 proc isfunction(L: PState, n: int): bool = 
-  Result = type(L, n) == TFUNCTION
+  Result = luatype(L, n) == TFUNCTION
 
 proc istable(L: PState, n: int): bool = 
-  Result = type(L, n) == TTABLE
+  Result = luatype(L, n) == TTABLE
 
 proc islightuserdata(L: PState, n: int): bool = 
-  Result = type(L, n) == TLIGHTUSERDATA
+  Result = luatype(L, n) == TLIGHTUSERDATA
 
 proc isnil(L: PState, n: int): bool = 
-  Result = type(L, n) == TNIL
+  Result = luatype(L, n) == TNIL
 
 proc isboolean(L: PState, n: int): bool = 
-  Result = type(L, n) == TBOOLEAN
+  Result = luatype(L, n) == TBOOLEAN
 
 proc isthread(L: PState, n: int): bool = 
-  Result = type(L, n) == TTHREAD
+  Result = luatype(L, n) == TTHREAD
 
 proc isnone(L: PState, n: int): bool = 
-  Result = type(L, n) == TNONE
+  Result = luatype(L, n) == TNONE
 
 proc isnoneornil(L: PState, n: int): bool = 
-  Result = type(L, n) <= 0
+  Result = luatype(L, n) <= 0
 
 proc pushliteral(L: PState, s: cstring) = 
   pushlstring(L, s, len(s))
diff --git a/lib/newwrap/lua/lualib.nim b/lib/newwrap/lua/lualib.nim
index c2c6cd97b..94f08a1f1 100755
--- a/lib/newwrap/lua/lualib.nim
+++ b/lib/newwrap/lua/lualib.nim
@@ -20,7 +20,7 @@
 #
 
 import 
-  
+  lua
 
 const 
   COLIBNAME* = "coroutine"
@@ -45,30 +45,22 @@ proc open_debug*(L: PState): cint{.cdecl, dynlib: LIB_NAME,
                                    importc: "luaopen_debug".}
 proc open_package*(L: PState): cint{.cdecl, dynlib: LIB_NAME, 
                                      importc: "luaopen_package".}
-proc L_openlibs*(L: PState){.cdecl, dynlib: LIB_NAME, importc: "luaL_openlibs".}
-  # compatibility code 
-proc baselibopen*(L: PState): Bool
-proc tablibopen*(L: PState): Bool
-proc iolibopen*(L: PState): Bool
-proc strlibopen*(L: PState): Bool
-proc mathlibopen*(L: PState): Bool
-proc dblibopen*(L: PState): Bool
-# implementation
+proc openlibs*(L: PState){.cdecl, dynlib: LIB_NAME, importc: "luaL_openlibs".}
 
-proc baselibopen(L: PState): Bool = 
+proc baselibopen*(L: PState): Bool = 
   Result = open_base(L) != 0'i32
 
-proc tablibopen(L: PState): Bool = 
+proc tablibopen*(L: PState): Bool = 
   Result = open_table(L) != 0'i32
 
-proc iolibopen(L: PState): Bool = 
+proc iolibopen*(L: PState): Bool = 
   Result = open_io(L) != 0'i32
 
-proc strlibopen(L: PState): Bool = 
+proc strlibopen*(L: PState): Bool = 
   Result = open_string(L) != 0'i32
 
-proc mathlibopen(L: PState): Bool = 
+proc mathlibopen*(L: PState): Bool = 
   Result = open_math(L) != 0'i32
 
-proc dblibopen(L: PState): Bool = 
+proc dblibopen*(L: PState): Bool = 
   Result = open_debug(L) != 0'i32
diff --git a/lib/newwrap/sdl/sdl.nim b/lib/newwrap/sdl/sdl.nim
index 40f2fafff..48553f96d 100755
--- a/lib/newwrap/sdl/sdl.nim
+++ b/lib/newwrap/sdl/sdl.nim
@@ -752,7 +752,7 @@ type
   THandle* = int              #SDL_types.h types
                               # Basic data types
   TBool* = enum 
-    FALSE, TRUE
+    sdlFALSE, sdlTRUE
   PUInt8Array* = ptr TUInt8Array
   PUInt8* = ptr UInt8
   PPUInt8* = ptr PUInt8
diff --git a/lib/newwrap/sdl/sdl_gfx.nim b/lib/newwrap/sdl/sdl_gfx.nim
index 39d4c3dc8..4bce944ec 100755
--- a/lib/newwrap/sdl/sdl_gfx.nim
+++ b/lib/newwrap/sdl/sdl_gfx.nim
@@ -18,7 +18,7 @@
 #
 
 import 
-  
+  sdl
 
 when defined(windows): 
   const 
diff --git a/lib/newwrap/sdl/sdl_image.nim b/lib/newwrap/sdl/sdl_image.nim
index 621749e32..f1f0eb8cc 100755
--- a/lib/newwrap/sdl/sdl_image.nim
+++ b/lib/newwrap/sdl/sdl_image.nim
@@ -129,7 +129,7 @@
 #******************************************************************************
 
 import 
-  
+  sdl
 
 when defined(windows): 
   const 
@@ -224,19 +224,9 @@ proc IMG_LoadXV_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXV_RW",
     dynlib: ImageLibName.}
 proc IMG_ReadXPMFromArray*(xpm: cstringArray): PSurface{.cdecl, 
     importc: "IMG_ReadXPMFromArray", dynlib: ImageLibName.}
-  # Error Macros 
-  # We'll use SDL for reporting errors 
-proc IMG_SetError*(fmt: cstring)
-proc IMG_GetError*(): cstring
-# implementation
 
 proc IMAGE_VERSION(X: var TVersion) = 
   X.major = IMAGE_MAJOR_VERSION
   X.minor = IMAGE_MINOR_VERSION
   X.patch = IMAGE_PATCHLEVEL
 
-proc IMG_SetError(fmt: cstring) = 
-  SetError(fmt)
-
-proc IMG_GetError(): cstring = 
-  result = GetError()
diff --git a/lib/newwrap/sdl/sdl_mixer.nim b/lib/newwrap/sdl/sdl_mixer.nim
index d4dd2e8df..cabf6fef7 100755
--- a/lib/newwrap/sdl/sdl_mixer.nim
+++ b/lib/newwrap/sdl/sdl_mixer.nim
@@ -149,7 +149,7 @@
 #******************************************************************************
 
 import 
-  , smpeg
+  sdl, smpeg
 
 when defined(windows): 
   const 
@@ -161,25 +161,22 @@ else:
   const 
     MixerLibName = "libSDL_mixer.so"
 const 
-  MIXER_MAJOR_VERSION* = 1'i8
-  MIXER_MINOR_VERSION* = 2'i8
-  MIXER_PATCHLEVEL* = 7'i8    # Backwards compatibility
-  MIX_MAJOR_VERSION* = MIXER_MAJOR_VERSION
-  MIX_MINOR_VERSION* = MIXER_MINOR_VERSION
-  MIX_PATCHLEVEL* = MIXER_PATCHLEVEL # SDL_Mixer.h constants
-                                     # The default mixer has 8 simultaneous mixing channels
-  MIX_CHANNELS* = 8           # Good default values for a PC soundcard
-  MIX_DEFAULT_FREQUENCY* = 22050
+  MAJOR_VERSION* = 1'i8
+  MINOR_VERSION* = 2'i8
+  PATCHLEVEL* = 7'i8    # Backwards compatibility
+  
+  CHANNELS* = 8           # Good default values for a PC soundcard
+  DEFAULT_FREQUENCY* = 22050
 
 when defined(IA32): 
   const 
-    MIX_DEFAULT_FORMAT* = AUDIO_S16LSB
+    DEFAULT_FORMAT* = AUDIO_S16LSB
 else: 
   const 
-    MIX_DEFAULT_FORMAT* = AUDIO_S16MSB
+    DEFAULT_FORMAT* = AUDIO_S16MSB
 const 
-  MIX_DEFAULT_CHANNELS* = 2
-  MIX_MAX_VOLUME* = 128       # Volume of a chunk
+  DEFAULT_CHANNELS* = 2
+  MAX_VOLUME* = 128       # Volume of a chunk
   PATH_MAX* = 255             # mikmod.h constants
                               #*
                               #  * Library version
@@ -254,34 +251,20 @@ type                          #music_cmd.h types
   PUNIMOD* = ptr TUNIMOD
   TUNIMOD* = TMODULE          #SDL_mixer.h types
                               # The internal format for an audio chunk
-  PMix_Chunk* = ptr TMix_Chunk
-  TMix_Chunk*{.final.} = object 
+  PChunk* = ptr TChunk
+  TChunk*{.final.} = object 
     allocated*: int
     abuf*: PUint8
     alen*: Uint32
     volume*: Uint8            # Per-sample volume, 0-128
   
-  Mix_Chunk* = TMix_Chunk     # The different fading types supported
-  TMix_Fading* = enum 
+  TFading* = enum 
     MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN
-  Mix_Fading* = TMix_Fading
-  TMix_MusicType* = enum 
+  TMusicType* = enum 
     MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG, MUS_MP3
-  Mix_MusicType* = TMix_MusicType #
-                                  #  TMusicUnion = record
-                                  #    case XXX: Byte of
-                                  #      0 : ( cmd : PMusicCMD );
-                                  #      1 : ( wave : PWAVStream );
-                                  #      2 : ( module : PUNIMOD );
-                                  #      3 : ( midi : TMidiSong );
-                                  #      4 : ( ogg : POGG_music );
-                                  #      {$IFNDEF DARWIN}
-                                  #      5 : ( mp3 : PSMPEG );
-                                  #      {$ENDIF}
-                                  #  end;
-  PMix_Music* = ptr TMix_Music
-  TMix_Music*{.final.} = object  # The internal format for a music chunk interpreted via mikmod
-    type_*: TMix_MusicType    # other fields are not aviable
+  PMusic* = ptr TMusic
+  TMusic*{.final.} = object  # The internal format for a music chunk interpreted via mikmod
+    mixtype*: TMusicType      # other fields are not aviable
                               #    data : TMusicUnion;
                               #    fading : TMix_Fading;
                               #    fade_volume : integer;
@@ -293,14 +276,14 @@ type                          #music_cmd.h types
       cdecl.} # This macro can be used to fill a version structure with the compile-time
               #  version of the SDL_mixer library.
 
-proc MIXER_VERSION*(X: var TVersion)
+proc VERSION*(X: var sdl.TVersion)
   # This function gets the version of the dynamically linked SDL_mixer library.
   #     It should NOT be used to fill a version structure, instead you should use the
   #     SDL_MIXER_VERSION() macro.
-proc Mix_Linked_Version*(): Pversion{.cdecl, importc: "Mix_Linked_Version", 
+proc Linked_Version*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version", 
                                       dynlib: MixerLibName.}
   # Open the mixer with a certain audio format
-proc Mix_OpenAudio*(frequency: int, format: Uint16, channels: int, 
+proc OpenAudio*(frequency: int, format: Uint16, channels: int, 
                     chunksize: int): int{.cdecl, importc: "Mix_OpenAudio", 
     dynlib: MixerLibName.}
   # Dynamically change the number of channels managed by the mixer.
@@ -308,456 +291,193 @@ proc Mix_OpenAudio*(frequency: int, format: Uint16, channels: int,
   #   stopped.
   #   This function returns the new number of allocated channels.
   #
-proc Mix_AllocateChannels*(numchannels: int): int{.cdecl, 
+proc AllocateChannels*(numchannels: int): int{.cdecl, 
     importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
   # Find out what the actual audio device parameters are.
   #   This function returns 1 if the audio has been opened, 0 otherwise.
   #
-proc Mix_QuerySpec*(frequency: var int, format: var Uint16, channels: var int): int{.
+proc QuerySpec*(frequency: var int, format: var Uint16, channels: var int): int{.
     cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
   # Load a wave file or a music (.mod .s3m .it .xm) file
-proc Mix_LoadWAV_RW*(src: PRWops, freesrc: int): PMix_Chunk{.cdecl, 
+proc LoadWAV_RW*(src: PRWops, freesrc: int): PChunk{.cdecl, 
     importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
-proc Mix_LoadWAV*(filename: cstring): PMix_Chunk
-proc Mix_LoadMUS*(filename: cstring): PMix_Music{.cdecl, importc: "Mix_LoadMUS", 
+proc LoadWAV*(filename: cstring): PChunk
+proc LoadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS", 
     dynlib: MixerLibName.}
   # Load a wave file of the mixer format from a memory buffer
-proc Mix_QuickLoad_WAV*(mem: PUint8): PMix_Chunk{.cdecl, 
+proc QuickLoad_WAV*(mem: PUint8): PChunk{.cdecl, 
     importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
   # Free an audio chunk previously loaded
-proc Mix_FreeChunk*(chunk: PMix_Chunk){.cdecl, importc: "Mix_FreeChunk", 
+proc FreeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk", 
                                         dynlib: MixerLibName.}
-proc Mix_FreeMusic*(music: PMix_Music){.cdecl, importc: "Mix_FreeMusic", 
+proc FreeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic", 
                                         dynlib: MixerLibName.}
   # Find out the music format of a mixer music, or the currently playing
   #   music, if 'music' is NULL.
-proc Mix_GetMusicType*(music: PMix_Music): TMix_MusicType{.cdecl, 
+proc GetMusicType*(music: PMusic): TMusicType{.cdecl, 
     importc: "Mix_GetMusicType", dynlib: MixerLibName.}
   # Set a function that is called after all mixing is performed.
   #   This can be used to provide real-time visual display of the audio stream
   #   or add a custom mixer filter for the stream data.
   #
-proc Mix_SetPostMix*(mix_func: TMixFunction, arg: Pointer){.cdecl, 
+proc SetPostMix*(mix_func: TMixFunction, arg: Pointer){.cdecl, 
     importc: "Mix_SetPostMix", dynlib: MixerLibName.}
   # Add your own music player or additional mixer function.
   #   If 'mix_func' is NULL, the default music player is re-enabled.
   #
-proc Mix_HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl, 
+proc HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl, 
     importc: "Mix_HookMusic", dynlib: MixerLibName.}
   # Add your own callback when the music has finished playing.
   #
-proc Mix_HookMusicFinished*(music_finished: Pointer){.cdecl, 
+proc HookMusicFinished*(music_finished: Pointer){.cdecl, 
     importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
   # Get a pointer to the user data for the current music hook
-proc Mix_GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData", 
+proc GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData", 
                                        dynlib: MixerLibName.}
   #* Add your own callback when a channel has finished playing. NULL
   # * to disable callback.*
 type 
   TChannel_finished* = proc (channel: int){.cdecl.}
 
-proc Mix_ChannelFinished*(channel_finished: TChannel_finished){.cdecl, 
+proc ChannelFinished*(channel_finished: TChannel_finished){.cdecl, 
     importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
 const 
-  MIX_CHANNEL_POST* = - 2 # This is the format of a special effect callback:
-                          #      myeffect(int chan, void *stream, int len, void *udata);
-                          #
-                          #    (chan) is the channel number that your effect is affecting. (stream) is
-                          #     the buffer of data to work upon. (len) is the size of (stream), and
-                          #     (udata) is a user-defined bit of data, which you pass as the last arg of
-                          #     Mix_RegisterEffect(), and is passed back unmolested to your callback.
-                          #     Your effect changes the contents of (stream) based on whatever parameters
-                          #     are significant, or just leaves it be, if you prefer. You can do whatever
-                          #     you like to the buffer, though, and it will continue in its changed state
-                          #     down the mixing pipeline, through any other effect functions, then finally
-                          #     to be mixed with the rest of the channels and music for the final output
-                          #     stream.
-                          #
+  CHANNEL_POST* = - 2     
 
 type 
-  TMix_EffectFunc* = proc (chan: int, stream: Pointer, length: int, 
-                           udata: Pointer): Pointer{.cdecl.} #   * This is a callback that signifies that a channel has finished all its
-                                                             #   *  loops and has completed playback. This gets called if the buffer
-                                                             #   *  plays out normally, or if you call Mix_HaltChannel(), implicitly stop
-                                                             #   *  a channel via 
-                                                             #   Mix_AllocateChannels(), or unregister a callback while
-                                                             #   *  it's still playing.
-  TMix_EffectDone* = proc (chan: int, udata: Pointer): Pointer{.cdecl.} #* Register a special effect function. At mixing time, the channel data is
-                                                                        #  *  copied into a buffer and passed through each registered effect function.
-                                                                        #  *  After it passes through all the functions, it is mixed into the final
-                                                                        #  *  output stream. The copy to buffer is performed once, then each effect
-                                                                        #  *  function performs on the output of the previous effect. Understand that
-                                                                        #  *  this extra copy to a buffer is not performed if there are no effects
-                                                                        #  *  registered for a given chunk, which saves CPU cycles, and any given
-                                                                        #  *  effect will be extra cycles, too, so it is crucial that your code run
-                                                                        #  *  fast. Also note that the data that your function is given is in the
-                                                                        #  *  format of the sound device, and not the format you gave to Mix_OpenAudio(),
-                                                                        #  *  although they may in reality be the same. This is an unfortunate but
-                                                                        #  *  necessary speed concern. Use Mix_QuerySpec() to determine if you can
-                                                                        #  *  handle the data before you register your effect, and take appropriate
-                                                                        #  *  actions.
-                                                                        #  * You may also specify a callback (Mix_EffectDone_t) that is called when
-                                                                        #  *  the channel finishes playing. This gives you a more fine-grained control
-                                                                        #  *  than Mix_ChannelFinished(), in case you need to free effect-specific
-                                                                        #  *  resources, etc. If you don't need this, you can specify NULL.
-                                                                        #  * You may set the callbacks before or after calling Mix_PlayChannel().
-                                                                        #  * Things like Mix_SetPanning() are just internal special effect functions,
-                                                                        #  *  so if you are using that, you've already incurred the overhead of a copy
-                                                                        #  *  to a separate buffer, and that these effects will be in the queue with
-                                                                        #  *  any functions you've registered. The list of registered effects for a
-                                                                        #  *  channel is reset when a chunk finishes playing, so you need to explicitly
-                                                                        #  *  set them with each call to Mix_PlayChannel*().
-                                                                        #  * You may also register a special effect function that is to be run after
-                                                                        #  *  final mixing occurs. The rules for these callbacks are identical to those
-                                                                        #  *  in Mix_RegisterEffect, but they are run after all the channels and the
-                                                                        #  *  music have been mixed into a single stream, whereas channel-specific
-                                                                        #  *  effects run on a given channel before any other mixing occurs. These
-                                                                        #  *  global effect callbacks are call "posteffects". Posteffects only have
-                                                                        #  *  their Mix_EffectDone_t function called when they are unregistered (since
-                                                                        #  *  the main output stream is never "done" in the same sense as a channel).
-                                                                        #  *  You must unregister them manually when you've had enough. Your callback
-                                                                        #  *  will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
-                                                                        #  *  processing is considered a posteffect.
-                                                                        #  *
-                                                                        #  * After all these effects have finished processing, the callback registered
-                                                                        #  *  through Mix_SetPostMix() runs, and then the stream goes to the audio
-                                                                        #  *  device.
-                                                                        #  *
-                                                                        #  * returns zero if error (no such channel), nonzero if added.
-                                                                        #  *  Error messages can be retrieved from Mix_GetError().
-                                                                        #  *
-
-proc Mix_RegisterEffect*(chan: int, f: TMix_EffectFunc, d: TMix_EffectDone, 
+  TEffectFunc* = proc (chan: int, stream: Pointer, length: int, 
+                       udata: Pointer): Pointer{.cdecl.}     
+  TEffectDone* = proc (chan: int, udata: Pointer): Pointer{.cdecl.} 
+proc RegisterEffect*(chan: int, f: TEffectFunc, d: TEffectDone, 
                          arg: Pointer): int{.cdecl, 
     importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
-  #* You may not need to call this explicitly, unless you need to stop an
-  # *  effect from processing in the middle of a chunk's playback.
-  # * Posteffects are never implicitly unregistered as they are for channels,
-  # *  but they may be explicitly unregistered through this function by
-  # *  specifying MIX_CHANNEL_POST for a channel.
-  # * returns zero if error (no such channel or effect), nonzero if removed.
-  # *  Error messages can be retrieved from Mix_GetError().
-  # *
-proc Mix_UnregisterEffect*(channel: int, f: TMix_EffectFunc): int{.cdecl, 
+
+proc UnregisterEffect*(channel: int, f: TEffectFunc): int{.cdecl, 
     importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
-  #* You may not need to call this explicitly, unless you need to stop all
-  #  * effects from processing in the middle of a chunk's playback. Note that
-  #  * this will also shut off some internal effect processing, since
-  #  * Mix_SetPanning( ) and others may use this API under the hood.This is
-  #  * called internally when a channel completes playback.
-  #  * Posteffects are never implicitly unregistered as they are for channels,
-  #  * but they may be explicitly unregistered through this function by
-  #  * specifying MIX_CHANNEL_POST for a channel.
-  #  * returns zero if error( no such channel ), nonzero if all effects removed.
-  #  * Error messages can be retrieved from Mix_GetError( ).
-  #  *
-proc Mix_UnregisterAllEffects*(channel: int): int{.cdecl, 
+
+proc UnregisterAllEffects*(channel: int): int{.cdecl, 
     importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
 const 
-  MIX_EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED" #  * These are the internally - defined mixing effects.They use the same API that
-                                               #  * effects defined in the application use, but are provided here as a
-                                               #  * convenience.Some effects can reduce their quality or use more memory in
-                                               #  * the name of speed; to enable this, make sure the environment variable
-                                               #  * MIX_EFFECTSMAXSPEED( see above ) is defined before you call
-                                               #  * Mix_OpenAudio( ).
-                                               #  *
-                                               #* set the panning of a channel.The left and right channels are specified
-                                               #  * as integers between 0 and 255, quietest to loudest, respectively.
-                                               #  *
-                                               #  * Technically, this is just individual volume control for a sample with
-                                               #  * two( stereo )channels, so it can be used for more than just panning.
-                                               #  * if you want real panning, call it like this :
-                                               #  *
-                                               #  * Mix_SetPanning( channel, left, 255 - left );
-                                               #  *
-                                               #  * ...which isn't so hard.
-                                               #  *
-                                               #  * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-                                               #  * the panning will be done to the final mixed stream before passing it on
-                                               #  * to the audio device.
-                                               #  *
-                                               #  * This uses the Mix_RegisterEffect( )API internally, and returns without
-                                               #  * registering the effect function if the audio device is not configured
-                                               #  * for stereo output.Setting both( left ) and ( right ) to 255 causes this
-                                               #  * effect to be unregistered, since that is the data's normal state.
-                                               #  *
-                                               #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-                                               #  * nonzero if panning effect enabled.Note that an audio device in mono
-                                               #  * mode is a no - op, but this call will return successful in that case .
-                                               #  * Error messages can be retrieved from Mix_GetError( ).
-                                               #  *
-
-proc Mix_SetPanning*(channel: int, left: Uint8, right: Uint8): int{.cdecl, 
+  EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED" 
+proc SetPanning*(channel: int, left: Uint8, right: Uint8): int{.cdecl, 
     importc: "Mix_SetPanning", dynlib: MixerLibName.}
-  # * set the position ofa channel.( angle ) is an integer from 0 to 360, that
-  #    * specifies the location of the sound in relation to the listener.( angle )
-  #    * will be reduced as neccesary( 540 becomes 180 degrees, -100 becomes 260 ).
-  #    * Angle 0 is due north, and rotates clockwise as the value increases.
-  #    * for efficiency, the precision of this effect may be limited( angles 1
-  #    * through 7 might all produce the same effect, 8 through 15 are equal, etc ).
-  #    * ( distance ) is an integer between 0 and 255 that specifies the space
-  #    * between the sound and the listener.The larger the number, the further
-  #    * away the sound is .Using 255 does not guarantee that the channel will be
-  #    * culled from the mixing process or be completely silent.For efficiency,
-  #    * the precision of this effect may be limited( distance 0 through 5 might
-  #    * all produce the same effect, 6 through 10 are equal, etc ).Setting( angle )
-  #    * and ( distance ) to 0 unregisters this effect, since the data would be
-  #    * unchanged.
-  #    *
-  #    * if you need more precise positional audio, consider using OpenAL for
-  #    * spatialized effects instead of SDL_mixer.This is only meant to be a
-  #    * basic effect for simple "3D" games.
-  #    *
-  #    * if the audio device is configured for mono output, then you won't get
-  #    * any effectiveness from the angle; however, distance attenuation on the
-  #  * channel will still occur.While this effect will function with stereo
-  #  * voices, it makes more sense to use voices with only one channel of sound,
-  #  * so when they are mixed through this effect, the positioning will sound
-  #  * correct.You can convert them to mono through SDL before giving them to
-  #  * the mixer in the first place if you like.
-  #  *
-  #  * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-  #  * the positioning will be done to the final mixed stream before passing it
-  #  * on to the audio device.
-  #  *
-  #  * This is a convenience wrapper over Mix_SetDistance( ) and Mix_SetPanning( ).
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if position effect is enabled.
-  #  * Error messages can be retrieved from Mix_GetError( ).
-  #  *
-proc Mix_SetPosition*(channel: int, angle: Sint16, distance: Uint8): int{.cdecl, 
+
+proc SetPosition*(channel: int, angle: Sint16, distance: Uint8): int{.cdecl, 
     importc: "Mix_SetPosition", dynlib: MixerLibName.}
-  #* set the "distance" of a channel.( distance ) is an integer from 0 to 255
-  #  * that specifies the location of the sound in relation to the listener.
-  #  * Distance 0 is overlapping the listener, and 255 is as far away as possible
-  #  * A distance of 255 does not guarantee silence; in such a case , you might
-  #  * want to try changing the chunk's volume, or just cull the sample from the
-  #  * mixing process with Mix_HaltChannel( ).
-  #    * for efficiency, the precision of this effect may be limited( distances 1
-  #    * through 7 might all produce the same effect, 8 through 15 are equal, etc ).
-  #    * ( distance ) is an integer between 0 and 255 that specifies the space
-  #    * between the sound and the listener.The larger the number, the further
-  #    * away the sound is .
-  #    * Setting( distance ) to 0 unregisters this effect, since the data would be
-  #    * unchanged.
-  #    * if you need more precise positional audio, consider using OpenAL for
-  #    * spatialized effects instead of SDL_mixer.This is only meant to be a
-  #    * basic effect for simple "3D" games.
-  #    *
-  #    * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-  #    * the distance attenuation will be done to the final mixed stream before
-  #    * passing it on to the audio device.
-  #    *
-  #  * This uses the Mix_RegisterEffect( )API internally.
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if position effect is enabled.
-  #    * Error messages can be retrieved from Mix_GetError( ).
-  #    *
-proc Mix_SetDistance*(channel: int, distance: Uint8): int{.cdecl, 
+
+proc SetDistance*(channel: int, distance: Uint8): int{.cdecl, 
     importc: "Mix_SetDistance", dynlib: MixerLibName.}
-  # *
-  #    * !!! FIXME : Haven't implemented, since the effect goes past the
-  #  * end of the sound buffer.Will have to think about this.
-  #  * - -ryan.
-  #  * /
-  #  { if 0
-  #  { * Causes an echo effect to be mixed into a sound.( echo ) is the amount
-  #  * of echo to mix.0 is no echo, 255 is infinite( and probably not
-  #  * what you want ).
-  #  *
-  #  * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-  #  * the reverbing will be done to the final mixed stream before passing it on
-  #  * to the audio device.
-  #  *
-  #  * This uses the Mix_RegisterEffect( )API internally.If you specify an echo
-  #  * of zero, the effect is unregistered, as the data is already in that state.
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if reversing effect is enabled.
-  #    * Error messages can be retrieved from Mix_GetError( ).
-  #    *
-  #    extern no_parse_DECLSPEC int Mix_SetReverb( int channel, Uint8 echo );
-  #  #E ndif
-  # * Causes a channel to reverse its stereo.This is handy if the user has his
-  #    * speakers hooked up backwards, or you would like to have a minor bit of
-  #  * psychedelia in your sound code. : )Calling this function with ( flip )
-  #  * set to non - zero reverses the chunks's usual channels. If (flip) is zero,
-  #  * the effect is unregistered.
-  #  *
-  #  * This uses the Mix_RegisterEffect( )API internally, and thus is probably
-  #  * more CPU intensive than having the user just plug in his speakers
-  #  * correctly.Mix_SetReverseStereo( )returns without registering the effect
-  #  * function if the audio device is not configured for stereo output.
-  #  *
-  #  * if you specify MIX_CHANNEL_POST for ( channel ), then this the effect is used
-  #  * on the final mixed stream before sending it on to the audio device( a
-  #  * posteffect ).
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if reversing effect is enabled.Note that an audio device in mono
-  #  * mode is a no - op, but this call will return successful in that case .
-  #  * Error messages can be retrieved from Mix_GetError( ).
-  #  *
-proc Mix_SetReverseStereo*(channel: int, flip: int): int{.cdecl, 
+
+proc SetReverseStereo*(channel: int, flip: int): int{.cdecl, 
     importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
-  # end of effects API. - -ryan. *
-  # Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
-  #   them dynamically to the next sample if requested with a -1 value below.
-  #   Returns the number of reserved channels.
-  #
-proc Mix_ReserveChannels*(num: int): int{.cdecl, importc: "Mix_ReserveChannels", 
+
+proc ReserveChannels*(num: int): int{.cdecl, importc: "Mix_ReserveChannels", 
     dynlib: MixerLibName.}
-  # Channel grouping functions
-  # Attach a tag to a channel. A tag can be assigned to several mixer
-  #   channels, to form groups of channels.
-  #   If 'tag' is -1, the tag is removed (actually -1 is the tag used to
-  #   represent the group of all the channels).
-  #   Returns true if everything was OK.
-  #
-proc Mix_GroupChannel*(which: int, tag: int): int{.cdecl, 
+
+proc GroupChannel*(which: int, tag: int): int{.cdecl, 
     importc: "Mix_GroupChannel", dynlib: MixerLibName.}
-  # Assign several consecutive channels to a group
-proc Mix_GroupChannels*(`from`: int, `to`: int, tag: int): int{.cdecl, 
+proc GroupChannels*(`from`: int, `to`: int, tag: int): int{.cdecl, 
     importc: "Mix_GroupChannels", dynlib: MixerLibName.}
-  # Finds the first available channel in a group of channels
-proc Mix_GroupAvailable*(tag: int): int{.cdecl, importc: "Mix_GroupAvailable", 
+proc GroupAvailable*(tag: int): int{.cdecl, importc: "Mix_GroupAvailable", 
     dynlib: MixerLibName.}
-  # Returns the number of channels in a group. This is also a subtle
-  #   way to get the total number of channels when 'tag' is -1
-  #
-proc Mix_GroupCount*(tag: int): int{.cdecl, importc: "Mix_GroupCount", 
+proc GroupCount*(tag: int): int{.cdecl, importc: "Mix_GroupCount", 
                                      dynlib: MixerLibName.}
-  # Finds the "oldest" sample playing in a group of channels
-proc Mix_GroupOldest*(tag: int): int{.cdecl, importc: "Mix_GroupOldest", 
+proc GroupOldest*(tag: int): int{.cdecl, importc: "Mix_GroupOldest", 
                                       dynlib: MixerLibName.}
-  # Finds the "most recent" (i.e. last) sample playing in a group of channels
-proc Mix_GroupNewer*(tag: int): int{.cdecl, importc: "Mix_GroupNewer", 
+proc GroupNewer*(tag: int): int{.cdecl, importc: "Mix_GroupNewer", 
                                      dynlib: MixerLibName.}
-  # The same as above, but the sound is played at most 'ticks' milliseconds
-proc Mix_PlayChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, 
+proc PlayChannelTimed*(channel: int, chunk: PChunk, loops: int, 
                            ticks: int): int{.cdecl, 
     importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
-  # Play an audio chunk on a specific channel.
-  #   If the specified channel is -1, play on the first free channel.
-  #   If 'loops' is greater than zero, loop the sound that many times.
-  #   If 'loops' is -1, loop inifinitely (~65000 times).
-  #   Returns which channel was used to play the sound.
-  #
-proc Mix_PlayChannel*(channel: int, chunk: PMix_Chunk, loops: int): int
-proc Mix_PlayMusic*(music: PMix_Music, loops: int): int{.cdecl, 
+proc PlayChannel*(channel: int, chunk: PChunk, loops: int): int
+proc PlayMusic*(music: PMusic, loops: int): int{.cdecl, 
     importc: "Mix_PlayMusic", dynlib: MixerLibName.}
-  # Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions
-proc Mix_FadeInMusic*(music: PMix_Music, loops: int, ms: int): int{.cdecl, 
+proc FadeInMusic*(music: PMusic, loops: int, ms: int): int{.cdecl, 
     importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
-proc Mix_FadeInChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, 
+proc FadeInChannelTimed*(channel: int, chunk: PChunk, loops: int, 
                              ms: int, ticks: int): int{.cdecl, 
     importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
-proc Mix_FadeInChannel*(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int
-  # Set the volume in the range of 0-128 of a specific channel or chunk.
-  #   If the specified channel is -1, set volume for all channels.
-  #   Returns the original volume.
-  #   If the specified volume is -1, just return the current volume.
-  #
-proc Mix_Volume*(channel: int, volume: int): int{.cdecl, importc: "Mix_Volume", 
+proc FadeInChannel*(channel: int, chunk: PChunk, loops: int, ms: int): int
+
+proc Volume*(channel: int, volume: int): int{.cdecl, importc: "Mix_Volume", 
     dynlib: MixerLibName.}
-proc Mix_VolumeChunk*(chunk: PMix_Chunk, volume: int): int{.cdecl, 
+proc VolumeChunk*(chunk: PChunk, volume: int): int{.cdecl, 
     importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
-proc Mix_VolumeMusic*(volume: int): int{.cdecl, importc: "Mix_VolumeMusic", 
+proc VolumeMusic*(volume: int): int{.cdecl, importc: "Mix_VolumeMusic", 
     dynlib: MixerLibName.}
-  # Halt playing of a particular channel
-proc Mix_HaltChannel*(channel: int): int{.cdecl, importc: "Mix_HaltChannel", 
+
+proc HaltChannel*(channel: int): int{.cdecl, importc: "Mix_HaltChannel", 
     dynlib: MixerLibName.}
-proc Mix_HaltGroup*(tag: int): int{.cdecl, importc: "Mix_HaltGroup", 
+proc HaltGroup*(tag: int): int{.cdecl, importc: "Mix_HaltGroup", 
                                     dynlib: MixerLibName.}
-proc Mix_HaltMusic*(): int{.cdecl, importc: "Mix_HaltMusic", 
+proc HaltMusic*(): int{.cdecl, importc: "Mix_HaltMusic", 
                             dynlib: MixerLibName.}
   # Change the expiration delay for a particular channel.
   #   The sample will stop playing after the 'ticks' milliseconds have elapsed,
   #   or remove the expiration if 'ticks' is -1
   #
-proc Mix_ExpireChannel*(channel: int, ticks: int): int{.cdecl, 
+proc ExpireChannel*(channel: int, ticks: int): int{.cdecl, 
     importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
   # Halt a channel, fading it out progressively till it's silent
   #   The ms parameter indicates the number of milliseconds the fading
   #   will take.
   #
-proc Mix_FadeOutChannel*(which: int, ms: int): int{.cdecl, 
+proc FadeOutChannel*(which: int, ms: int): int{.cdecl, 
     importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
-proc Mix_FadeOutGroup*(tag: int, ms: int): int{.cdecl, 
+proc FadeOutGroup*(tag: int, ms: int): int{.cdecl, 
     importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
-proc Mix_FadeOutMusic*(ms: int): int{.cdecl, importc: "Mix_FadeOutMusic", 
+proc FadeOutMusic*(ms: int): int{.cdecl, importc: "Mix_FadeOutMusic", 
                                       dynlib: MixerLibName.}
   # Query the fading status of a channel
-proc Mix_FadingMusic*(): TMix_Fading{.cdecl, importc: "Mix_FadingMusic", 
+proc FadingMusic*(): TFading{.cdecl, importc: "Mix_FadingMusic", 
                                       dynlib: MixerLibName.}
-proc Mix_FadingChannel*(which: int): TMix_Fading{.cdecl, 
+proc FadingChannel*(which: int): TFading{.cdecl, 
     importc: "Mix_FadingChannel", dynlib: MixerLibName.}
-  # Pause/Resume a particular channel
-proc Mix_Pause*(channel: int){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
-proc Mix_Resume*(channel: int){.cdecl, importc: "Mix_Resume", 
+
+proc Pause*(channel: int){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
+proc Resume*(channel: int){.cdecl, importc: "Mix_Resume", 
                                 dynlib: MixerLibName.}
-proc Mix_Paused*(channel: int): int{.cdecl, importc: "Mix_Paused", 
+proc Paused*(channel: int): int{.cdecl, importc: "Mix_Paused", 
                                      dynlib: MixerLibName.}
-  # Pause/Resume the music stream
-proc Mix_PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
-proc Mix_ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
-proc Mix_RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
-proc Mix_PausedMusic*(): int{.cdecl, importc: "Mix_PausedMusic", 
+
+proc PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
+proc ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
+proc RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
+proc PausedMusic*(): int{.cdecl, importc: "Mix_PausedMusic", 
                               dynlib: MixerLibName.}
-  # Set the current position in the music stream.
-  #  This returns 0 if successful, or -1 if it failed or isn't implemented.
-  #  This function is only implemented for MOD music formats (set pattern
-  #  order number) and for OGG music (set position in seconds), at the
-  #  moment.
-  #
-proc Mix_SetMusicPosition*(position: float64): int{.cdecl, 
+
+proc SetMusicPosition*(position: float64): int{.cdecl, 
     importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
-  # Check the status of a specific channel.
-  #   If the specified channel is -1, check all channels.
-  #
-proc Mix_Playing*(channel: int): int{.cdecl, importc: "Mix_Playing", 
+
+proc Playing*(channel: int): int{.cdecl, importc: "Mix_Playing", 
                                       dynlib: MixerLibName.}
-proc Mix_PlayingMusic*(): int{.cdecl, importc: "Mix_PlayingMusic", 
+proc PlayingMusic*(): int{.cdecl, importc: "Mix_PlayingMusic", 
                                dynlib: MixerLibName.}
-  # Stop music and set external music playback command
-proc Mix_SetMusicCMD*(command: cstring): int{.cdecl, importc: "Mix_SetMusicCMD", 
+
+proc SetMusicCMD*(command: cstring): int{.cdecl, importc: "Mix_SetMusicCMD", 
     dynlib: MixerLibName.}
-  # Synchro value is set by MikMod from modules while playing
-proc Mix_SetSynchroValue*(value: int): int{.cdecl, 
+
+proc SetSynchroValue*(value: int): int{.cdecl, 
     importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
-proc Mix_GetSynchroValue*(): int{.cdecl, importc: "Mix_GetSynchroValue", 
+proc GetSynchroValue*(): int{.cdecl, importc: "Mix_GetSynchroValue", 
                                   dynlib: MixerLibName.}
-  #
-  #  Get the Mix_Chunk currently associated with a mixer channel
-  #    Returns nil if it's an invalid channel, or there's no chunk associated.
-  #
-proc Mix_GetChunk*(channel: int): PMix_Chunk{.cdecl, importc: "Mix_GetChunk", 
+
+proc GetChunk*(channel: int): PChunk{.cdecl, importc: "Mix_GetChunk", 
     dynlib: MixerLibName.}
-  # Close the mixer, halting all playing audio
-proc Mix_CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
-  # We'll use SDL for reporting errors
-proc Mix_SetError*(fmt: cstring)
-proc Mix_GetError*(): cstring
-# implementation
 
-proc MIXER_VERSION(X: var Tversion) = 
-  X.major = MIXER_MAJOR_VERSION
-  X.minor = MIXER_MINOR_VERSION
-  X.patch = MIXER_PATCHLEVEL
+proc CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
 
-proc Mix_LoadWAV(filename: cstring): PMix_Chunk = 
-  result = Mix_LoadWAV_RW(RWFromFile(filename, "rb"), 1)
+proc VERSION(X: var sdl.Tversion) = 
+  X.major = MAJOR_VERSION
+  X.minor = MINOR_VERSION
+  X.patch = PATCHLEVEL
 
-proc Mix_PlayChannel(channel: int, chunk: PMix_Chunk, loops: int): int = 
-  result = Mix_PlayChannelTimed(channel, chunk, loops, - 1)
+proc LoadWAV(filename: cstring): PChunk = 
+  result = LoadWAV_RW(RWFromFile(filename, "rb"), 1)
 
-proc Mix_FadeInChannel(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int = 
-  result = Mix_FadeInChannelTimed(channel, chunk, loops, ms, - 1)
+proc PlayChannel(channel: int, chunk: PChunk, loops: int): int = 
+  result = PlayChannelTimed(channel, chunk, loops, - 1)
 
-proc Mix_SetError(fmt: cstring) = 
-  SetError(fmt)
+proc FadeInChannel(channel: int, chunk: PChunk, loops: int, ms: int): int = 
+  result = FadeInChannelTimed(channel, chunk, loops, ms, - 1)
 
-proc Mix_GetError(): cstring = 
-  result = GetError()
diff --git a/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim b/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim
index 571263014..3fe7cac14 100755
--- a/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim
+++ b/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim
@@ -3,7 +3,7 @@
 #******************************************************************************
 
 import 
-  
+  sdl
 
 when defined(windows): 
   const 
@@ -15,29 +15,24 @@ else:
   const 
     MixerLibName = "libSDL_mixer.so"
 const 
-  MIXER_MAJOR_VERSION* = 1'i8
-  MIXER_MINOR_VERSION* = 2'i8
-  MIXER_PATCHLEVEL* = 7'i8    # Backwards compatibility
-  MIX_MAJOR_VERSION* = MIXER_MAJOR_VERSION
-  MIX_MINOR_VERSION* = MIXER_MINOR_VERSION
-  MIX_PATCHLEVEL* = MIXER_PATCHLEVEL # SDL_Mixer.h constants
-                                     # The default mixer has 8 simultaneous mixing channels 
-  MIX_CHANNELS* = 8           # Good default values for a PC soundcard 
-  MIX_DEFAULT_FREQUENCY* = 22050
+  MAJOR_VERSION* = 1'i8
+  MINOR_VERSION* = 2'i8
+  PATCHLEVEL* = 7'i8    # Backwards compatibility
+   
+  CHANNELS* = 8           # Good default values for a PC soundcard 
+  DEFAULT_FREQUENCY* = 22050
 
 when defined(IA32): 
   const 
-    MIX_DEFAULT_FORMAT* = AUDIO_S16LSB
+    DEFAULT_FORMAT* = AUDIO_S16LSB
 else: 
   const 
-    MIX_DEFAULT_FORMAT* = AUDIO_S16MSB
+    DEFAULT_FORMAT* = AUDIO_S16MSB
 const 
-  MIX_DEFAULT_CHANNELS* = 2
-  MIX_MAX_VOLUME* = 128       # Volume of a chunk 
-  PATH_MAX* = 255             # mikmod.h constants
-                              #*
-                              #  * Library version
-                              #  *
+  DEFAULT_CHANNELS* = 2
+  MAX_VOLUME* = 128       # Volume of a chunk 
+  PATH_MAX* = 255
+  
   LIBMIKMOD_VERSION_MAJOR* = 3
   LIBMIKMOD_VERSION_MINOR* = 1
   LIBMIKMOD_REVISION* = 8
@@ -108,35 +103,33 @@ type                          #music_cmd.h types
   PUNIMOD* = ptr TUNIMOD
   TUNIMOD* = TMODULE          #SDL_mixer.h types
                               # The internal format for an audio chunk 
-  PMix_Chunk* = ptr TMix_Chunk
-  TMix_Chunk*{.final.} = object 
+  PChunk* = ptr TChunk
+  TChunk*{.final.} = object 
     allocated*: int
     abuf*: PUint8
     alen*: Uint32
     volume*: Uint8            # Per-sample volume, 0-128 
   
-  Mix_Chunk* = TMix_Chunk     # The different fading types supported 
-  TMix_Fading* = enum 
+  TFading* = enum 
     MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN
-  Mix_Fading* = TMix_Fading
-  TMix_MusicType* = enum 
+  TMusicType* = enum 
     MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG
-  PMix_Music* = ptr TMix_Music
-  TMix_Music*{.final.} = object 
-    type_*: TMix_MusicType
+  PMusic* = ptr TMusic
+  TMusic*{.final.} = object 
+    type_*: TMusicType
 
   TMixFunction* = proc (udata: Pointer, stream: PUint8, length: int): Pointer{.
       cdecl.} # This macro can be used to fill a version structure with the compile-time
               #  version of the SDL_mixer library. 
 
-proc MIXER_VERSION*(X: var TVersion)
+proc VERSION*(X: var sdl.TVersion)
   # This function gets the version of the dynamically linked SDL_mixer library.
   #     It should NOT be used to fill a version structure, instead you should use the
   #     SDL_MIXER_VERSION() macro. 
-proc Mix_Linked_Version*(): Pversion{.cdecl, importc: "Mix_Linked_Version", 
+proc Linked_Version*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version", 
                                       dynlib: MixerLibName.}
   # Open the mixer with a certain audio format 
-proc Mix_OpenAudio*(frequency: int, format: Uint16, channels: int, 
+proc OpenAudio*(frequency: int, format: Uint16, channels: int, 
                     chunksize: int): int{.cdecl, importc: "Mix_OpenAudio", 
     dynlib: MixerLibName.}
   # Dynamically change the number of channels managed by the mixer.
@@ -144,402 +137,170 @@ proc Mix_OpenAudio*(frequency: int, format: Uint16, channels: int,
   #   stopped.
   #   This function returns the new number of allocated channels.
   # 
-proc Mix_AllocateChannels*(numchannels: int): int{.cdecl, 
+proc AllocateChannels*(numchannels: int): int{.cdecl, 
     importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
   # Find out what the actual audio device parameters are.
   #   This function returns 1 if the audio has been opened, 0 otherwise.
   # 
-proc Mix_QuerySpec*(frequency: var int, format: var Uint16, channels: var int): int{.
+proc QuerySpec*(frequency: var int, format: var Uint16, channels: var int): int{.
     cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
   # Load a wave file or a music (.mod .s3m .it .xm) file 
-proc Mix_LoadWAV_RW*(src: PRWops, freesrc: int): PMix_Chunk{.cdecl, 
+proc LoadWAV_RW*(src: PRWops, freesrc: int): PChunk{.cdecl, 
     importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
-proc Mix_LoadWAV*(filename: cstring): PMix_Chunk
-proc Mix_LoadMUS*(filename: cstring): PMix_Music{.cdecl, importc: "Mix_LoadMUS", 
+proc LoadWAV*(filename: cstring): PChunk
+proc LoadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS", 
     dynlib: MixerLibName.}
   # Load a wave file of the mixer format from a memory buffer 
-proc Mix_QuickLoad_WAV*(mem: PUint8): PMix_Chunk{.cdecl, 
+proc QuickLoad_WAV*(mem: PUint8): PChunk{.cdecl, 
     importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
   # Free an audio chunk previously loaded 
-proc Mix_FreeChunk*(chunk: PMix_Chunk){.cdecl, importc: "Mix_FreeChunk", 
+proc FreeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk", 
                                         dynlib: MixerLibName.}
-proc Mix_FreeMusic*(music: PMix_Music){.cdecl, importc: "Mix_FreeMusic", 
+proc FreeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic", 
                                         dynlib: MixerLibName.}
   # Find out the music format of a mixer music, or the currently playing
   #   music, if 'music' is NULL.
-proc Mix_GetMusicType*(music: PMix_Music): TMix_MusicType{.cdecl, 
+proc GetMusicType*(music: PMusic): TMusicType{.cdecl, 
     importc: "Mix_GetMusicType", dynlib: MixerLibName.}
   # Set a function that is called after all mixing is performed.
   #   This can be used to provide real-time visual display of the audio stream
   #   or add a custom mixer filter for the stream data.
   #
-proc Mix_SetPostMix*(mix_func: TMixFunction, arg: Pointer){.cdecl, 
+proc SetPostMix*(mixfunc: TMixFunction, arg: Pointer){.cdecl, 
     importc: "Mix_SetPostMix", dynlib: MixerLibName.}
   # Add your own music player or additional mixer function.
   #   If 'mix_func' is NULL, the default music player is re-enabled.
   # 
-proc Mix_HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl, 
+proc HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl, 
     importc: "Mix_HookMusic", dynlib: MixerLibName.}
   # Add your own callback when the music has finished playing.
   # 
-proc Mix_HookMusicFinished*(music_finished: Pointer){.cdecl, 
+proc HookMusicFinished*(music_finished: Pointer){.cdecl, 
     importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
   # Get a pointer to the user data for the current music hook 
-proc Mix_GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData", 
+proc GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData", 
                                        dynlib: MixerLibName.}
   #* Add your own callback when a channel has finished playing. NULL
   # * to disable callback.*
 type 
   TChannel_finished* = proc (channel: int){.cdecl.}
 
-proc Mix_ChannelFinished*(channel_finished: TChannel_finished){.cdecl, 
+proc ChannelFinished*(channel_finished: TChannel_finished){.cdecl, 
     importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
 const 
-  MIX_CHANNEL_POST* = - 2 #* This is the format of a special effect callback:
-                          #   *
-                          #   *   myeffect(int chan, void *stream, int len, void *udata);
-                          #   *
-                          #   * (chan) is the channel number that your effect is affecting. (stream) is
-                          #   *  the buffer of data to work upon. (len) is the size of (stream), and
-                          #   *  (udata) is a user-defined bit of data, which you pass as the last arg of
-                          #   *  Mix_RegisterEffect(), and is passed back unmolested to your callback.
-                          #   *  Your effect changes the contents of (stream) based on whatever parameters
-                          #   *  are significant, or just leaves it be, if you prefer. You can do whatever
-                          #   *  you like to the buffer, though, and it will continue in its changed state
-                          #   *  down the mixing pipeline, through any other effect functions, then finally
-                          #   *  to be mixed with the rest of the channels and music for the final output
-                          #   *  stream.
-                          #   *
-
+  CHANNEL_POST* = - 2 
+  
 type 
-  TMix_EffectFunc* = proc (chan: int, stream: Pointer, length: int, 
-                           udata: Pointer): Pointer{.cdecl.} #   * This is a callback that signifies that a channel has finished all its
-                                                             #   *  loops and has completed playback. This gets called if the buffer
-                                                             #   *  plays out normally, or if you call Mix_HaltChannel(), implicitly stop
-                                                             #   *  a channel via 
-                                                             #   Mix_AllocateChannels(), or unregister a callback while
-                                                             #   *  it's still playing.
-  TMix_EffectDone* = proc (chan: int, udata: Pointer): Pointer{.cdecl.} #* Register a special effect function. At mixing time, the channel data is
-                                                                        #  *  copied into a buffer and passed through each registered effect function.
-                                                                        #  *  After it passes through all the functions, it is mixed into the final
-                                                                        #  *  output stream. The copy to buffer is performed once, then each effect
-                                                                        #  *  function performs on the output of the previous effect. Understand that
-                                                                        #  *  this extra copy to a buffer is not performed if there are no effects
-                                                                        #  *  registered for a given chunk, which saves CPU cycles, and any given
-                                                                        #  *  effect will be extra cycles, too, so it is crucial that your code run
-                                                                        #  *  fast. Also note that the data that your function is given is in the
-                                                                        #  *  format of the sound device, and not the format you gave to Mix_OpenAudio(),
-                                                                        #  *  although they may in reality be the same. This is an unfortunate but
-                                                                        #  *  necessary speed concern. Use Mix_QuerySpec() to determine if you can
-                                                                        #  *  handle the data before you register your effect, and take appropriate
-                                                                        #  *  actions.
-                                                                        #  * You may also specify a callback (Mix_EffectDone_t) that is called when
-                                                                        #  *  the channel finishes playing. This gives you a more fine-grained control
-                                                                        #  *  than Mix_ChannelFinished(), in case you need to free effect-specific
-                                                                        #  *  resources, etc. If you don't need this, you can specify NULL.
-                                                                        #  * You may set the callbacks before or after calling Mix_PlayChannel().
-                                                                        #  * Things like Mix_SetPanning() are just internal special effect functions,
-                                                                        #  *  so if you are using that, you've already incurred the overhead of a copy
-                                                                        #  *  to a separate buffer, and that these effects will be in the queue with
-                                                                        #  *  any functions you've registered. The list of registered effects for a
-                                                                        #  *  channel is reset when a chunk finishes playing, so you need to explicitly
-                                                                        #  *  set them with each call to Mix_PlayChannel*().
-                                                                        #  * You may also register a special effect function that is to be run after
-                                                                        #  *  final mixing occurs. The rules for these callbacks are identical to those
-                                                                        #  *  in Mix_RegisterEffect, but they are run after all the channels and the
-                                                                        #  *  music have been mixed into a single stream, whereas channel-specific
-                                                                        #  *  effects run on a given channel before any other mixing occurs. These
-                                                                        #  *  global effect callbacks are call "posteffects". Posteffects only have
-                                                                        #  *  their Mix_EffectDone_t function called when they are unregistered (since
-                                                                        #  *  the main output stream is never "done" in the same sense as a channel).
-                                                                        #  *  You must unregister them manually when you've had enough. Your callback
-                                                                        #  *  will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
-                                                                        #  *  processing is considered a posteffect.
-                                                                        #  *
-                                                                        #  * After all these effects have finished processing, the callback registered
-                                                                        #  *  through Mix_SetPostMix() runs, and then the stream goes to the audio
-                                                                        #  *  device.
-                                                                        #  *
-                                                                        #  * returns zero if error (no such channel), nonzero if added.
-                                                                        #  *  Error messages can be retrieved from Mix_GetError().
+  TEffectFunc* = proc (chan: int, stream: Pointer, length: int, 
+                           udata: Pointer): Pointer{.cdecl.} 
+  TEffectDone* = proc (chan: int, udata: Pointer): Pointer{.cdecl.} 
 
-proc Mix_RegisterEffect*(chan: int, f: TMix_EffectFunc, d: TMix_EffectDone, 
+proc RegisterEffect*(chan: int, f: TEffectFunc, d: TEffectDone, 
                          arg: Pointer): int{.cdecl, 
     importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
-  #* You may not need to call this explicitly, unless you need to stop an
-  # *  effect from processing in the middle of a chunk's playback.
-  # * Posteffects are never implicitly unregistered as they are for channels,
-  # *  but they may be explicitly unregistered through this function by
-  # *  specifying MIX_CHANNEL_POST for a channel.
-  # * returns zero if error (no such channel or effect), nonzero if removed.
-  # *  Error messages can be retrieved from Mix_GetError().
-  # *
-proc Mix_UnregisterEffect*(channel: int, f: TMix_EffectFunc): int{.cdecl, 
+
+proc UnregisterEffect*(channel: int, f: TEffectFunc): int{.cdecl, 
     importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
-  #* You may not need to call this explicitly, unless you need to stop all
-  #  * effects from processing in the middle of a chunk's playback. Note that
-  #  * this will also shut off some internal effect processing, since
-  #  * Mix_SetPanning( ) and others may use this API under the hood.This is
-  #  * called internally when a channel completes playback.
-  #  * Posteffects are never implicitly unregistered as they are for channels,
-  #  * but they may be explicitly unregistered through this function by
-  #  * specifying MIX_CHANNEL_POST for a channel.
-  #  * returns zero if error( no such channel ), nonzero if all effects removed.
-  #  * Error messages can be retrieved from Mix_GetError( ).
-  #  *
-proc Mix_UnregisterAllEffects*(channel: int): int{.cdecl, 
+
+proc UnregisterAllEffects*(channel: int): int{.cdecl, 
     importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
-const 
-  MIX_EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED" #  * These are the internally - defined mixing effects.They use the same API that
-                                               #  * effects defined in the application use, but are provided here as a
-                                               #  * convenience.Some effects can reduce their quality or use more memory in
-                                               #  * the name of speed; to enable this, make sure the environment variable
-                                               #  * MIX_EFFECTSMAXSPEED( see above ) is defined before you call
-                                               #  * Mix_OpenAudio( ).
-                                               #  * 
-                                               #* set the panning of a channel.The left and right channels are specified
-                                               #  * as integers between 0 and 255, quietest to loudest, respectively.
-                                               #  *
-                                               #  * Technically, this is just individual volume control for a sample with
-                                               #  * two( stereo )channels, so it can be used for more than just panning.
-                                               #  * if you want real panning, call it like this :
-                                               #  *
-                                               #  * Mix_SetPanning( channel, left, 255 - left );
-                                               #  *
-                                               #  * ...which isn't so hard.
-                                               #  *
-                                               #  * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-                                               #  * the panning will be done to the final mixed stream before passing it on
-                                               #  * to the audio device.
-                                               #  *
-                                               #  * This uses the Mix_RegisterEffect( )API internally, and returns without
-                                               #  * registering the effect function if the audio device is not configured
-                                               #  * for stereo output.Setting both( left ) and ( right ) to 255 causes this
-                                               #  * effect to be unregistered, since that is the data's normal state.
-                                               #  *
-                                               #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-                                               #  * nonzero if panning effect enabled.Note that an audio device in mono
-                                               #  * mode is a no - op, but this call will return successful in that case .
-                                               #  * Error messages can be retrieved from Mix_GetError( ).
 
-proc Mix_SetPanning*(channel: int, left: Uint8, right: Uint8): int{.cdecl, 
+const 
+  EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED"  
+  
+proc SetPanning*(channel: int, left: Uint8, right: Uint8): int{.cdecl, 
     importc: "Mix_SetPanning", dynlib: MixerLibName.}
-  # * set the position ofa channel.( angle ) is an integer from 0 to 360, that
-  #    * specifies the location of the sound in relation to the listener.( angle )
-  #    * will be reduced as neccesary( 540 becomes 180 degrees, -100 becomes 260 ).
-  #    * Angle 0 is due north, and rotates clockwise as the value increases.
-  #    * for efficiency, the precision of this effect may be limited( angles 1
-  #    * through 7 might all produce the same effect, 8 through 15 are equal, etc ).
-  #    * ( distance ) is an integer between 0 and 255 that specifies the space
-  #    * between the sound and the listener.The larger the number, the further
-  #    * away the sound is .Using 255 does not guarantee that the channel will be
-  #    * culled from the mixing process or be completely silent.For efficiency,
-  #    * the precision of this effect may be limited( distance 0 through 5 might
-  #    * all produce the same effect, 6 through 10 are equal, etc ).Setting( angle )
-  #    * and ( distance ) to 0 unregisters this effect, since the data would be
-  #    * unchanged.
-  #    *
-  #    * if you need more precise positional audio, consider using OpenAL for
-  #    * spatialized effects instead of SDL_mixer.This is only meant to be a
-  #    * basic effect for simple "3D" games.
-  #    *
-  #    * if the audio device is configured for mono output, then you won't get
-  #    * any effectiveness from the angle; however, distance attenuation on the
-  #  * channel will still occur.While this effect will function with stereo
-  #  * voices, it makes more sense to use voices with only one channel of sound,
-  #  * so when they are mixed through this effect, the positioning will sound
-  #  * correct.You can convert them to mono through SDL before giving them to
-  #  * the mixer in the first place if you like.
-  #  *
-  #  * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-  #  * the positioning will be done to the final mixed stream before passing it
-  #  * on to the audio device.
-  #  *
-  #  * This is a convenience wrapper over Mix_SetDistance( ) and Mix_SetPanning( ).
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if position effect is enabled.
-  #  * Error messages can be retrieved from Mix_GetError( ).
-  #  * 
-proc Mix_SetPosition*(channel: int, angle: Sint16, distance: Uint8): int{.cdecl, 
+   
+proc SetPosition*(channel: int, angle: Sint16, distance: Uint8): int{.cdecl, 
     importc: "Mix_SetPosition", dynlib: MixerLibName.}
-  #* set the "distance" of a channel.( distance ) is an integer from 0 to 255
-  #  * that specifies the location of the sound in relation to the listener.
-  #  * Distance 0 is overlapping the listener, and 255 is as far away as possible
-  #  * A distance of 255 does not guarantee silence; in such a case , you might
-  #  * want to try changing the chunk's volume, or just cull the sample from the
-  #  * mixing process with Mix_HaltChannel( ).
-  #    * for efficiency, the precision of this effect may be limited( distances 1
-  #    * through 7 might all produce the same effect, 8 through 15 are equal, etc ).
-  #    * ( distance ) is an integer between 0 and 255 that specifies the space
-  #    * between the sound and the listener.The larger the number, the further
-  #    * away the sound is .
-  #    * Setting( distance ) to 0 unregisters this effect, since the data would be
-  #    * unchanged.
-  #    * if you need more precise positional audio, consider using OpenAL for
-  #    * spatialized effects instead of SDL_mixer.This is only meant to be a
-  #    * basic effect for simple "3D" games.
-  #    *
-  #    * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-  #    * the distance attenuation will be done to the final mixed stream before
-  #    * passing it on to the audio device.
-  #    *
-  #  * This uses the Mix_RegisterEffect( )API internally.
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if position effect is enabled.
-  #    * Error messages can be retrieved from Mix_GetError( ).
-  #    * 
-proc Mix_SetDistance*(channel: int, distance: Uint8): int{.cdecl, 
+   
+proc SetDistance*(channel: int, distance: Uint8): int{.cdecl, 
     importc: "Mix_SetDistance", dynlib: MixerLibName.}
-  # *
-  #    * !!! FIXME : Haven't implemented, since the effect goes past the
-  #  * end of the sound buffer.Will have to think about this.
-  #  * - -ryan.
-  #  * /
-  #  { if 0
-  #  { * Causes an echo effect to be mixed into a sound.( echo ) is the amount
-  #  * of echo to mix.0 is no echo, 255 is infinite( and probably not
-  #  * what you want ).
-  #  *
-  #  * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and
-  #  * the reverbing will be done to the final mixed stream before passing it on
-  #  * to the audio device.
-  #  *
-  #  * This uses the Mix_RegisterEffect( )API internally.If you specify an echo
-  #  * of zero, the effect is unregistered, as the data is already in that state.
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if reversing effect is enabled.
-  #    * Error messages can be retrieved from Mix_GetError( ).
-  #    *
-  #    extern no_parse_DECLSPEC int Mix_SetReverb( int channel, Uint8 echo );
-  #  #E ndif
-  # * Causes a channel to reverse its stereo.This is handy if the user has his
-  #    * speakers hooked up backwards, or you would like to have a minor bit of
-  #  * psychedelia in your sound code. : )Calling this function with ( flip )
-  #  * set to non - zero reverses the chunks's usual channels. If (flip) is zero,
-  #  * the effect is unregistered.
-  #  *
-  #  * This uses the Mix_RegisterEffect( )API internally, and thus is probably
-  #  * more CPU intensive than having the user just plug in his speakers
-  #  * correctly.Mix_SetReverseStereo( )returns without registering the effect
-  #  * function if the audio device is not configured for stereo output.
-  #  *
-  #  * if you specify MIX_CHANNEL_POST for ( channel ), then this the effect is used
-  #  * on the final mixed stream before sending it on to the audio device( a
-  #  * posteffect ).
-  #  *
-  #  * returns zero if error( no such channel or Mix_RegisterEffect( )fails ),
-  #  * nonzero if reversing effect is enabled.Note that an audio device in mono
-  #  * mode is a no - op, but this call will return successful in that case .
-  #  * Error messages can be retrieved from Mix_GetError( ).
-  #  * 
-proc Mix_SetReverseStereo*(channel: int, flip: int): int{.cdecl, 
+
+proc SetReverseStereo*(channel: int, flip: int): int{.cdecl, 
     importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
-  # end of effects API. - -ryan. *
-  # Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
-  #   them dynamically to the next sample if requested with a -1 value below.
-  #   Returns the number of reserved channels.
-  # 
-proc Mix_ReserveChannels*(num: int): int{.cdecl, importc: "Mix_ReserveChannels", 
+
+proc ReserveChannels*(num: int): int{.cdecl, importc: "Mix_ReserveChannels", 
     dynlib: MixerLibName.}
-  # Channel grouping functions 
-  # Attach a tag to a channel. A tag can be assigned to several mixer
-  #   channels, to form groups of channels.
-  #   If 'tag' is -1, the tag is removed (actually -1 is the tag used to
-  #   represent the group of all the channels).
-  #   Returns true if everything was OK.
-  # 
-proc Mix_GroupChannel*(which: int, tag: int): int{.cdecl, 
+
+proc GroupChannel*(which: int, tag: int): int{.cdecl, 
     importc: "Mix_GroupChannel", dynlib: MixerLibName.}
   # Assign several consecutive channels to a group 
-proc Mix_GroupChannels*(`from`: int, `to`: int, tag: int): int{.cdecl, 
+proc GroupChannels*(`from`: int, `to`: int, tag: int): int{.cdecl, 
     importc: "Mix_GroupChannels", dynlib: MixerLibName.}
   # Finds the first available channel in a group of channels 
-proc Mix_GroupAvailable*(tag: int): int{.cdecl, importc: "Mix_GroupAvailable", 
+proc GroupAvailable*(tag: int): int{.cdecl, importc: "Mix_GroupAvailable", 
     dynlib: MixerLibName.}
   # Returns the number of channels in a group. This is also a subtle
   #   way to get the total number of channels when 'tag' is -1
   # 
-proc Mix_GroupCount*(tag: int): int{.cdecl, importc: "Mix_GroupCount", 
+proc GroupCount*(tag: int): int{.cdecl, importc: "Mix_GroupCount", 
                                      dynlib: MixerLibName.}
   # Finds the "oldest" sample playing in a group of channels 
-proc Mix_GroupOldest*(tag: int): int{.cdecl, importc: "Mix_GroupOldest", 
+proc GroupOldest*(tag: int): int{.cdecl, importc: "Mix_GroupOldest", 
                                       dynlib: MixerLibName.}
   # Finds the "most recent" (i.e. last) sample playing in a group of channels 
-proc Mix_GroupNewer*(tag: int): int{.cdecl, importc: "Mix_GroupNewer", 
+proc GroupNewer*(tag: int): int{.cdecl, importc: "Mix_GroupNewer", 
                                      dynlib: MixerLibName.}
   # The same as above, but the sound is played at most 'ticks' milliseconds 
-proc Mix_PlayChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, 
+proc PlayChannelTimed*(channel: int, chunk: PChunk, loops: int, 
                            ticks: int): int{.cdecl, 
     importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
-  # Play an audio chunk on a specific channel.
-  #   If the specified channel is -1, play on the first free channel.
-  #   If 'loops' is greater than zero, loop the sound that many times.
-  #   If 'loops' is -1, loop inifinitely (~65000 times).
-  #   Returns which channel was used to play the sound.
-  #
-proc Mix_PlayChannel*(channel: int, chunk: PMix_Chunk, loops: int): int
-proc Mix_PlayMusic*(music: PMix_Music, loops: int): int{.cdecl, 
+
+proc PlayChannel*(channel: int, chunk: PChunk, loops: int): int
+proc PlayMusic*(music: PMusic, loops: int): int{.cdecl, 
     importc: "Mix_PlayMusic", dynlib: MixerLibName.}
   # Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions 
-proc Mix_FadeInMusic*(music: PMix_Music, loops: int, ms: int): int{.cdecl, 
+proc FadeInMusic*(music: PMusic, loops: int, ms: int): int{.cdecl, 
     importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
-proc Mix_FadeInChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, 
+proc FadeInChannelTimed*(channel: int, chunk: PChunk, loops: int, 
                              ms: int, ticks: int): int{.cdecl, 
     importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
-proc Mix_FadeInChannel*(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int
+proc FadeInChannel*(channel: int, chunk: PChunk, loops: int, ms: int): int
   # Set the volume in the range of 0-128 of a specific channel or chunk.
   #   If the specified channel is -1, set volume for all channels.
   #   Returns the original volume.
   #   If the specified volume is -1, just return the current volume.
   #
-proc Mix_Volume*(channel: int, volume: int): int{.cdecl, importc: "Mix_Volume", 
+proc Volume*(channel: int, volume: int): int{.cdecl, importc: "Mix_Volume", 
     dynlib: MixerLibName.}
-proc Mix_VolumeChunk*(chunk: PMix_Chunk, volume: int): int{.cdecl, 
+proc VolumeChunk*(chunk: PChunk, volume: int): int{.cdecl, 
     importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
-proc Mix_VolumeMusic*(volume: int): int{.cdecl, importc: "Mix_VolumeMusic", 
+proc VolumeMusic*(volume: int): int{.cdecl, importc: "Mix_VolumeMusic", 
     dynlib: MixerLibName.}
   # Halt playing of a particular channel 
-proc Mix_HaltChannel*(channel: int): int{.cdecl, importc: "Mix_HaltChannel", 
+proc HaltChannel*(channel: int): int{.cdecl, importc: "Mix_HaltChannel", 
     dynlib: MixerLibName.}
-proc Mix_HaltGroup*(tag: int): int{.cdecl, importc: "Mix_HaltGroup", 
+proc HaltGroup*(tag: int): int{.cdecl, importc: "Mix_HaltGroup", 
                                     dynlib: MixerLibName.}
-proc Mix_HaltMusic*(): int{.cdecl, importc: "Mix_HaltMusic", 
+proc HaltMusic*(): int{.cdecl, importc: "Mix_HaltMusic", 
                             dynlib: MixerLibName.}
-  # Change the expiration delay for a particular channel.
-  #   The sample will stop playing after the 'ticks' milliseconds have elapsed,
-  #   or remove the expiration if 'ticks' is -1
-  #
-proc Mix_ExpireChannel*(channel: int, ticks: int): int{.cdecl, 
+
+proc ExpireChannel*(channel: int, ticks: int): int{.cdecl, 
     importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
-  # Halt a channel, fading it out progressively till it's silent
-  #   The ms parameter indicates the number of milliseconds the fading
-  #   will take.
-  # 
-proc Mix_FadeOutChannel*(which: int, ms: int): int{.cdecl, 
+
+proc FadeOutChannel*(which: int, ms: int): int{.cdecl, 
     importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
-proc Mix_FadeOutGroup*(tag: int, ms: int): int{.cdecl, 
+proc FadeOutGroup*(tag: int, ms: int): int{.cdecl, 
     importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
-proc Mix_FadeOutMusic*(ms: int): int{.cdecl, importc: "Mix_FadeOutMusic", 
+proc FadeOutMusic*(ms: int): int{.cdecl, importc: "Mix_FadeOutMusic", 
                                       dynlib: MixerLibName.}
   # Query the fading status of a channel 
-proc Mix_FadingMusic*(): TMix_Fading{.cdecl, importc: "Mix_FadingMusic", 
+proc FadingMusic*(): TFading{.cdecl, importc: "Mix_FadingMusic", 
                                       dynlib: MixerLibName.}
-proc Mix_FadingChannel*(which: int): TMix_Fading{.cdecl, 
+proc FadingChannel*(which: int): TFading{.cdecl, 
     importc: "Mix_FadingChannel", dynlib: MixerLibName.}
   # Pause/Resume a particular channel 
-proc Mix_Pause*(channel: int){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
-proc Mix_Resume*(channel: int){.cdecl, importc: "Mix_Resume", 
+proc Pause*(channel: int){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
+proc Resume*(channel: int){.cdecl, importc: "Mix_Resume", 
                                 dynlib: MixerLibName.}
-proc Mix_Paused*(channel: int): int{.cdecl, importc: "Mix_Paused", 
+proc Paused*(channel: int): int{.cdecl, importc: "Mix_Paused", 
                                      dynlib: MixerLibName.}
   # Pause/Resume the music stream 
-proc Mix_PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
-proc Mix_ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
-proc Mix_RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
-proc Mix_PausedMusic*(): int{.cdecl, importc: "Mix_PausedMusic", 
+proc PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
+proc ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
+proc RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
+proc PausedMusic*(): int{.cdecl, importc: "Mix_PausedMusic", 
                               dynlib: MixerLibName.}
   # Set the current position in the music stream.
   #  This returns 0 if successful, or -1 if it failed or isn't implemented.
@@ -547,52 +308,44 @@ proc Mix_PausedMusic*(): int{.cdecl, importc: "Mix_PausedMusic",
   #  order number) and for OGG music (set position in seconds), at the
   #  moment.
   #
-proc Mix_SetMusicPosition*(position: float64): int{.cdecl, 
+proc SetMusicPosition*(position: float64): int{.cdecl, 
     importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
   # Check the status of a specific channel.
   #   If the specified channel is -1, check all channels.
   #
-proc Mix_Playing*(channel: int): int{.cdecl, importc: "Mix_Playing", 
+proc Playing*(channel: int): int{.cdecl, importc: "Mix_Playing", 
                                       dynlib: MixerLibName.}
-proc Mix_PlayingMusic*(): int{.cdecl, importc: "Mix_PlayingMusic", 
+proc PlayingMusic*(): int{.cdecl, importc: "Mix_PlayingMusic", 
                                dynlib: MixerLibName.}
   # Stop music and set external music playback command 
-proc Mix_SetMusicCMD*(command: cstring): int{.cdecl, importc: "Mix_SetMusicCMD", 
+proc SetMusicCMD*(command: cstring): int{.cdecl, importc: "Mix_SetMusicCMD", 
     dynlib: MixerLibName.}
   # Synchro value is set by MikMod from modules while playing 
-proc Mix_SetSynchroValue*(value: int): int{.cdecl, 
+proc SetSynchroValue*(value: int): int{.cdecl, 
     importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
-proc Mix_GetSynchroValue*(): int{.cdecl, importc: "Mix_GetSynchroValue", 
+proc GetSynchroValue*(): int{.cdecl, importc: "Mix_GetSynchroValue", 
                                   dynlib: MixerLibName.}
   #
   #  Get the Mix_Chunk currently associated with a mixer channel
   #    Returns nil if it's an invalid channel, or there's no chunk associated.
   #
-proc Mix_GetChunk*(channel: int): PMix_Chunk{.cdecl, importc: "Mix_GetChunk", 
+proc GetChunk*(channel: int): PChunk{.cdecl, importc: "Mix_GetChunk", 
     dynlib: MixerLibName.}
   # Close the mixer, halting all playing audio 
-proc Mix_CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
+proc CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
   # We'll use SDL for reporting errors 
-proc Mix_SetError*(fmt: cstring)
-proc Mix_GetError*(): cstring
-# implementation
-
-proc MIXER_VERSION(X: var Tversion) = 
-  X.major = MIXER_MAJOR_VERSION
-  X.minor = MIXER_MINOR_VERSION
-  X.patch = MIXER_PATCHLEVEL
 
-proc Mix_LoadWAV(filename: cstring): PMix_Chunk = 
-  result = Mix_LoadWAV_RW(RWFromFile(filename, "rb"), 1)
+proc VERSION(X: var Tversion) = 
+  X.major = MAJOR_VERSION
+  X.minor = MINOR_VERSION
+  X.patch = PATCHLEVEL
 
-proc Mix_PlayChannel(channel: int, chunk: PMix_Chunk, loops: int): int = 
-  result = Mix_PlayChannelTimed(channel, chunk, loops, - 1)
+proc LoadWAV(filename: cstring): PChunk = 
+  result = LoadWAV_RW(RWFromFile(filename, "rb"), 1)
 
-proc Mix_FadeInChannel(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int = 
-  result = Mix_FadeInChannelTimed(channel, chunk, loops, ms, - 1)
+proc PlayChannel(channel: int, chunk: PChunk, loops: int): int = 
+  result = PlayChannelTimed(channel, chunk, loops, - 1)
 
-proc Mix_SetError(fmt: cstring) = 
-  SetError(fmt)
+proc FadeInChannel(channel: int, chunk: PChunk, loops: int, ms: int): int = 
+  result = FadeInChannelTimed(channel, chunk, loops, ms, - 1)
 
-proc Mix_GetError(): cstring = 
-  result = GetError()
diff --git a/lib/newwrap/sdl/sdl_net.nim b/lib/newwrap/sdl/sdl_net.nim
index 09318bc79..5a6445af9 100755
--- a/lib/newwrap/sdl/sdl_net.nim
+++ b/lib/newwrap/sdl/sdl_net.nim
@@ -110,7 +110,7 @@
 #******************************************************************************
 
 import 
-  
+  sdl
 
 when defined(windows): 
   const 
@@ -122,9 +122,9 @@ else:
   const 
     NetLibName = "libSDL_net.so"
 const                         #* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL *
-  NET_MAJOR_VERSION* = 1'i8
-  NET_MINOR_VERSION* = 2'i8
-  NET_PATCHLEVEL* = 5'i8 # SDL_Net.h constants
+  MAJOR_VERSION* = 1'i8
+  MINOR_VERSION* = 2'i8
+  PATCHLEVEL* = 5'i8     # SDL_Net.h constants
                          #* Resolve a host name and port to an IP address in network form.
                          #   If the function succeeds, it will return 0.
                          #   If the host couldn't be resolved, the host portion of the returned
@@ -136,8 +136,8 @@ const                         #* Printable format: "%d.%d.%d", MAJOR, MINOR, PAT
                             #* UDP network API                                                     *
                             #***********************************************************************
                             #* The maximum channels on a a UDP socket *
-  NET_MAX_UDPCHANNELS* = 32   #* The maximum addresses bound to a single UDP socket channel *
-  NET_MAX_UDPADDRESSES* = 4
+  MAX_UDPCHANNELS* = 32   #* The maximum addresses bound to a single UDP socket channel *
+  MAX_UDPADDRESSES* = 4
 
 type  # SDL_net.h types
       #***********************************************************************
@@ -149,9 +149,7 @@ type  # SDL_net.h types
     port*: Uint16             # 16-bit protocol port */
   
   PTCPSocket* = ptr TTCPSocket
-  TTCPSocket*{.final.} = object  #***********************************************************************
-                                 #* UDP network API                                                     *
-                                 #***********************************************************************
+  TTCPSocket*{.final.} = object  # UDP network API
     ready*: int
     channel*: int
     remoteAddress*: TIPaddress
@@ -161,14 +159,14 @@ type  # SDL_net.h types
   PUDP_Channel* = ptr TUDP_Channel
   TUDP_Channel*{.final.} = object 
     numbound*: int
-    address*: array[0..NET_MAX_UDPADDRESSES - 1, TIPAddress]
+    address*: array[0..MAX_UDPADDRESSES - 1, TIPAddress]
 
   PUDPSocket* = ptr TUDPSocket
   TUDPSocket*{.final.} = object 
     ready*: int
     channel*: int
     address*: TIPAddress
-    binding*: array[0..NET_MAX_UDPCHANNELS - 1, TUDP_Channel]
+    binding*: array[0..MAX_UDPCHANNELS - 1, TUDP_Channel]
 
   PUDPpacket* = ptr TUDPpacket
   PPUDPpacket* = ptr PUDPpacket
@@ -182,44 +180,43 @@ type  # SDL_net.h types
     status*: int              #* packet status after sending *
     address*: TIPAddress      #* The source/dest address of an incoming/outgoing packet *
   
-  PNet_Socket* = ptr TNet_Socket
-  TNet_Socket*{.final.} = object 
+  PSocket* = ptr TSocket
+  TSocket*{.final.} = object 
     ready*: int
     channel*: int
 
-  PNet_SocketSet* = ptr TNet_SocketSet
-  TNet_SocketSet*{.final.} = object  #* Any network socket can be safely cast to this socket type *
+  PSocketSet* = ptr TSocketSet
+  TSocketSet*{.final.} = object  # Any network socket can be safely cast to this socket type *
     numsockets*: int
     maxsockets*: int
-    sockets*: PNet_Socket
+    sockets*: PSocket
 
-  PNet_GenericSocket* = ptr TNet_GenericSocket
-  TNet_GenericSocket*{.final.} = object  # This macro can be used to fill a version structure with the compile-time
-                                         #  version of the SDL_net library. 
+  PGenericSocket* = ptr TGenericSocket
+  TGenericSocket*{.final.} = object 
     ready*: int
 
 
-proc NET_VERSION*(X: var Tversion)
+proc VERSION*(X: var Tversion)
   #* Initialize/Cleanup the network API
   #   SDL must be initialized before calls to functions in this library,
   #   because this library uses utility functions from the SDL library.
   #*
-proc Net_Init*(): int{.cdecl, importc: "SDLNet_Init", dynlib: NetLibName.}
-proc Net_Quit*(){.cdecl, importc: "SDLNet_Quit", dynlib: NetLibName.}
+proc Init*(): int{.cdecl, importc: "SDLNet_Init", dynlib: NetLibName.}
+proc Quit*(){.cdecl, importc: "SDLNet_Quit", dynlib: NetLibName.}
   #* Resolve a host name and port to an IP address in network form.
   #   If the function succeeds, it will return 0.
   #   If the host couldn't be resolved, the host portion of the returned
   #   address will be INADDR_NONE, and the function will return -1.
   #   If 'host' is NULL, the resolved host will be set to INADDR_ANY.
   # *
-proc Net_ResolveHost*(address: var TIPaddress, host: cstring, port: Uint16): int{.
+proc ResolveHost*(address: var TIPaddress, host: cstring, port: Uint16): int{.
     cdecl, importc: "SDLNet_ResolveHost", dynlib: NetLibName.}
   #* Resolve an ip address to a host name in canonical form.
   #   If the ip couldn't be resolved, this function returns NULL,
   #   otherwise a pointer to a static buffer containing the hostname
   #   is returned.  Note that this function is not thread-safe.
   #*
-proc Net_ResolveIP*(ip: var TIPaddress): cstring{.cdecl, 
+proc ResolveIP*(ip: var TIPaddress): cstring{.cdecl, 
     importc: "SDLNet_ResolveIP", dynlib: NetLibName.}
   #***********************************************************************
   #* TCP network API                                                     *
@@ -232,24 +229,24 @@ proc Net_ResolveIP*(ip: var TIPaddress): cstring{.cdecl,
   #   in the correct form).
   #   The newly created socket is returned, or NULL if there was an error.
   #*
-proc Net_TCP_Open*(ip: var TIPaddress): PTCPSocket{.cdecl, 
+proc TCP_Open*(ip: var TIPaddress): PTCPSocket{.cdecl, 
     importc: "SDLNet_TCP_Open", dynlib: NetLibName.}
   #* Accept an incoming connection on the given server socket.
   #   The newly created socket is returned, or NULL if there was an error.
   #*
-proc Net_TCP_Accept*(server: PTCPsocket): PTCPSocket{.cdecl, 
+proc TCP_Accept*(server: PTCPsocket): PTCPSocket{.cdecl, 
     importc: "SDLNet_TCP_Accept", dynlib: NetLibName.}
   #* Get the IP address of the remote system associated with the socket.
   #   If the socket is a server socket, this function returns NULL.
   #*
-proc Net_TCP_GetPeerAddress*(sock: PTCPsocket): PIPAddress{.cdecl, 
+proc TCP_GetPeerAddress*(sock: PTCPsocket): PIPAddress{.cdecl, 
     importc: "SDLNet_TCP_GetPeerAddress", dynlib: NetLibName.}
   #* Send 'len' bytes of 'data' over the non-server socket 'sock'
   #   This function returns the actual amount of data sent.  If the return value
   #   is less than the amount of data sent, then either the remote connection was
   #   closed, or an unknown socket error occurred.
   #*
-proc Net_TCP_Send*(sock: PTCPsocket, data: Pointer, length: int): int{.cdecl, 
+proc TCP_Send*(sock: PTCPsocket, data: Pointer, length: int): int{.cdecl, 
     importc: "SDLNet_TCP_Send", dynlib: NetLibName.}
   #* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
   #   and store them in the buffer pointed to by 'data'.
@@ -257,10 +254,10 @@ proc Net_TCP_Send*(sock: PTCPsocket, data: Pointer, length: int): int{.cdecl,
   #   value is less than or equal to zero, then either the remote connection was
   #   closed, or an unknown socket error occurred.
   #*
-proc Net_TCP_Recv*(sock: PTCPsocket, data: Pointer, maxlen: int): int{.cdecl, 
+proc TCP_Recv*(sock: PTCPsocket, data: Pointer, maxlen: int): int{.cdecl, 
     importc: "SDLNet_TCP_Recv", dynlib: NetLibName.}
   #* Close a TCP network socket *
-proc Net_TCP_Close*(sock: PTCPsocket){.cdecl, importc: "SDLNet_TCP_Close", 
+proc TCP_Close*(sock: PTCPsocket){.cdecl, importc: "SDLNet_TCP_Close", 
                                        dynlib: NetLibName.}
   #***********************************************************************
   #* UDP network API                                                     *
@@ -268,26 +265,26 @@ proc Net_TCP_Close*(sock: PTCPsocket){.cdecl, importc: "SDLNet_TCP_Close",
   #* Allocate/resize/free a single UDP packet 'size' bytes long.
   #   The new packet is returned, or NULL if the function ran out of memory.
   # *
-proc Net_AllocPacket*(size: int): PUDPpacket{.cdecl, 
+proc AllocPacket*(size: int): PUDPpacket{.cdecl, 
     importc: "SDLNet_AllocPacket", dynlib: NetLibName.}
-proc Net_ResizePacket*(packet: PUDPpacket, newsize: int): int{.cdecl, 
+proc ResizePacket*(packet: PUDPpacket, newsize: int): int{.cdecl, 
     importc: "SDLNet_ResizePacket", dynlib: NetLibName.}
-proc Net_FreePacket*(packet: PUDPpacket){.cdecl, importc: "SDLNet_FreePacket", 
+proc FreePacket*(packet: PUDPpacket){.cdecl, importc: "SDLNet_FreePacket", 
     dynlib: NetLibName.}
   #* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets,
   #   each 'size' bytes long.
   #   A pointer to the first packet in the array is returned, or NULL if the
   #   function ran out of memory.
   # *
-proc Net_AllocPacketV*(howmany: int, size: int): PUDPpacket{.cdecl, 
+proc AllocPacketV*(howmany: int, size: int): PUDPpacket{.cdecl, 
     importc: "SDLNet_AllocPacketV", dynlib: NetLibName.}
-proc Net_FreePacketV*(packetV: PUDPpacket){.cdecl, 
+proc FreePacketV*(packetV: PUDPpacket){.cdecl, 
     importc: "SDLNet_FreePacketV", dynlib: NetLibName.}
   #* Open a UDP network socket
   #   If 'port' is non-zero, the UDP socket is bound to a local port.
   #   This allows other systems to send to this socket via a known port.
   #*
-proc Net_UDP_Open*(port: Uint16): PUDPsocket{.cdecl, importc: "SDLNet_UDP_Open", 
+proc UDP_Open*(port: Uint16): PUDPsocket{.cdecl, importc: "SDLNet_UDP_Open", 
     dynlib: NetLibName.}
   #* Bind the address 'address' to the requested channel on the UDP socket.
   #   If the channel is -1, then the first unbound channel will be bound with
@@ -298,10 +295,10 @@ proc Net_UDP_Open*(port: Uint16): PUDPsocket{.cdecl, importc: "SDLNet_UDP_Open",
   #   address, to which all outbound packets on the channel are sent.
   #   This function returns the channel which was bound, or -1 on error.
   #*
-proc Net_UDP_Bind*(sock: PUDPsocket, channel: int, address: var TIPaddress): int{.
+proc UDP_Bind*(sock: PUDPsocket, channel: int, address: var TIPaddress): int{.
     cdecl, importc: "SDLNet_UDP_Bind", dynlib: NetLibName.}
   #* Unbind all addresses from the given channel *
-proc Net_UDP_Unbind*(sock: PUDPsocket, channel: int){.cdecl, 
+proc UDP_Unbind*(sock: PUDPsocket, channel: int){.cdecl, 
     importc: "SDLNet_UDP_Unbind", dynlib: NetLibName.}
   #* Get the primary IP address of the remote system associated with the
   #   socket and channel.  If the channel is -1, then the primary IP port
@@ -309,7 +306,7 @@ proc Net_UDP_Unbind*(sock: PUDPsocket, channel: int){.cdecl,
   #   opened with a specific port.
   #   If the channel is not bound and not -1, this function returns NULL.
   # *
-proc Net_UDP_GetPeerAddress*(sock: PUDPsocket, channel: int): PIPAddress{.cdecl, 
+proc UDP_GetPeerAddress*(sock: PUDPsocket, channel: int): PIPAddress{.cdecl, 
     importc: "SDLNet_UDP_GetPeerAddress", dynlib: NetLibName.}
   #* Send a vector of packets to the the channels specified within the packet.
   #   If the channel specified in the packet is -1, the packet will be sent to
@@ -318,7 +315,7 @@ proc Net_UDP_GetPeerAddress*(sock: PUDPsocket, channel: int): PIPAddress{.cdecl,
   #   been sent, -1 if the packet send failed.
   #   This function returns the number of packets sent.
   #*
-proc Net_UDP_SendV*(sock: PUDPsocket, packets: PPUDPpacket, npackets: int): int{.
+proc UDP_SendV*(sock: PUDPsocket, packets: PPUDPpacket, npackets: int): int{.
     cdecl, importc: "SDLNet_UDP_SendV", dynlib: NetLibName.}
   #* Send a single packet to the specified channel.
   #   If the channel specified in the packet is -1, the packet will be sent to
@@ -327,7 +324,7 @@ proc Net_UDP_SendV*(sock: PUDPsocket, packets: PPUDPpacket, npackets: int): int{
   #   been sent.
   #   This function returns 1 if the packet was sent, or 0 on error.
   #*
-proc Net_UDP_Send*(sock: PUDPsocket, channel: int, packet: PUDPpacket): int{.
+proc UDP_Send*(sock: PUDPsocket, channel: int, packet: PUDPpacket): int{.
     cdecl, importc: "SDLNet_UDP_Send", dynlib: NetLibName.}
   #* Receive a vector of pending packets from the UDP socket.
   #   The returned packets contain the source address and the channel they arrived
@@ -339,7 +336,7 @@ proc Net_UDP_Send*(sock: PUDPsocket, channel: int, packet: PUDPpacket): int{.
   #   This function returns the number of packets read from the network, or -1
   #   on error.  This function does not block, so can return 0 packets pending.
   #*
-proc Net_UDP_RecvV*(sock: PUDPsocket, packets: PPUDPpacket): int{.cdecl, 
+proc UDP_RecvV*(sock: PUDPsocket, packets: PPUDPpacket): int{.cdecl, 
     importc: "SDLNet_UDP_RecvV", dynlib: NetLibName.}
   #* Receive a single packet from the UDP socket.
   #   The returned packet contains the source address and the channel it arrived
@@ -351,10 +348,10 @@ proc Net_UDP_RecvV*(sock: PUDPsocket, packets: PPUDPpacket): int{.cdecl,
   #   This function returns the number of packets read from the network, or -1
   #   on error.  This function does not block, so can return 0 packets pending.
   #*
-proc Net_UDP_Recv*(sock: PUDPsocket, packet: PUDPpacket): int{.cdecl, 
+proc UDP_Recv*(sock: PUDPsocket, packet: PUDPpacket): int{.cdecl, 
     importc: "SDLNet_UDP_Recv", dynlib: NetLibName.}
   #* Close a UDP network socket *
-proc Net_UDP_Close*(sock: PUDPsocket){.cdecl, importc: "SDLNet_UDP_Close", 
+proc UDP_Close*(sock: PUDPsocket){.cdecl, importc: "SDLNet_UDP_Close", 
                                        dynlib: NetLibName.}
   #***********************************************************************
   #* Hooks for checking sockets for available data                       *
@@ -363,19 +360,19 @@ proc Net_UDP_Close*(sock: PUDPsocket){.cdecl, importc: "SDLNet_UDP_Close",
   #   This returns a socket set for up to 'maxsockets' sockets, or NULL if
   #   the function ran out of memory.
   # *
-proc Net_AllocSocketSet*(maxsockets: int): PNet_SocketSet{.cdecl, 
+proc AllocSocketSet*(maxsockets: int): PSocketSet{.cdecl, 
     importc: "SDLNet_AllocSocketSet", dynlib: NetLibName.}
   #* Add a socket to a set of sockets to be checked for available data *
-proc Net_AddSocket*(theSet: PNet_SocketSet, sock: PNet_GenericSocket): int{.
+proc AddSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
     cdecl, importc: "SDLNet_AddSocket", dynlib: NetLibName.}
-proc Net_TCP_AddSocket*(theSet: PNet_SocketSet, sock: PTCPSocket): int
-proc Net_UDP_AddSocket*(theSet: PNet_SocketSet, sock: PUDPSocket): int
+proc TCP_AddSocket*(theSet: PSocketSet, sock: PTCPSocket): int
+proc UDP_AddSocket*(theSet: PSocketSet, sock: PUDPSocket): int
   #* Remove a socket from a set of sockets to be checked for available data *
-proc Net_DelSocket*(theSet: PNet_SocketSet, sock: PNet_GenericSocket): int{.
+proc DelSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
     cdecl, importc: "SDLNet_DelSocket", dynlib: NetLibName.}
-proc Net_TCP_DelSocket*(theSet: PNet_SocketSet, sock: PTCPSocket): int
+proc TCP_DelSocket*(theSet: PSocketSet, sock: PTCPSocket): int
   # SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
-proc Net_UDP_DelSocket*(theSet: PNet_SocketSet, sock: PUDPSocket): int
+proc UDP_DelSocket*(theSet: PSocketSet, sock: PUDPSocket): int
   #SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
   #* This function checks to see if data is available for reading on the
   #   given set of sockets.  If 'timeout' is 0, it performs a quick poll,
@@ -384,59 +381,47 @@ proc Net_UDP_DelSocket*(theSet: PNet_SocketSet, sock: PUDPSocket): int
   #   first.  This function returns the number of sockets ready for reading,
   #   or -1 if there was an error with the select() system call.
   #*
-proc Net_CheckSockets*(theSet: PNet_SocketSet, timeout: Sint32): int{.cdecl, 
+proc CheckSockets*(theSet: PSocketSet, timeout: Sint32): int{.cdecl, 
     importc: "SDLNet_CheckSockets", dynlib: NetLibName.}
   #* After calling SDLNet_CheckSockets(), you can use this function on a
   #   socket that was in the socket set, to find out if data is available
   #   for reading.
   #*
-proc Net_SocketReady*(sock: PNet_GenericSocket): bool
+proc SocketReady*(sock: PGenericSocket): bool
   #* Free a set of sockets allocated by SDL_NetAllocSocketSet() *
-proc Net_FreeSocketSet*(theSet: PNet_SocketSet){.cdecl, 
+proc FreeSocketSet*(theSet: PSocketSet){.cdecl, 
     importc: "SDLNet_FreeSocketSet", dynlib: NetLibName.}
   #***********************************************************************
   #* Platform-independent data conversion functions                      *
   #***********************************************************************
   #* Write a 16/32 bit value to network packet buffer *
-proc Net_Write16*(value: Uint16, area: Pointer){.cdecl, 
+proc Write16*(value: Uint16, area: Pointer){.cdecl, 
     importc: "SDLNet_Write16", dynlib: NetLibName.}
-proc Net_Write32*(value: Uint32, area: Pointer){.cdecl, 
+proc Write32*(value: Uint32, area: Pointer){.cdecl, 
     importc: "SDLNet_Write32", dynlib: NetLibName.}
   #* Read a 16/32 bit value from network packet buffer *
-proc Net_Read16*(area: Pointer): Uint16{.cdecl, importc: "SDLNet_Read16", 
+proc Read16*(area: Pointer): Uint16{.cdecl, importc: "SDLNet_Read16", 
     dynlib: NetLibName.}
-proc Net_Read32*(area: Pointer): Uint32{.cdecl, importc: "SDLNet_Read32", 
+proc Read32*(area: Pointer): Uint32{.cdecl, importc: "SDLNet_Read32", 
     dynlib: NetLibName.}
-  #***********************************************************************
-  #* Error reporting functions                                           *
-  #***********************************************************************
-  #* We'll use SDL's functions for error reporting *
-proc Net_SetError*(fmt: cstring)
-proc Net_GetError*(): cstring
-# implementation
 
-proc NET_VERSION(X: var Tversion) = 
-  X.major = NET_MAJOR_VERSION
-  X.minor = NET_MINOR_VERSION
-  X.patch = NET_PATCHLEVEL
+proc VERSION(X: var Tversion) = 
+  X.major = MAJOR_VERSION
+  X.minor = MINOR_VERSION
+  X.patch = PATCHLEVEL
 
-proc Net_TCP_AddSocket(theSet: PNet_SocketSet, sock: PTCPSocket): int = 
-  result = Net_AddSocket(theSet, cast[PNet_GenericSocket](sock))
+proc TCP_AddSocket(theSet: PSocketSet, sock: PTCPSocket): int = 
+  result = AddSocket(theSet, cast[PGenericSocket](sock))
 
-proc Net_UDP_AddSocket(theSet: PNet_SocketSet, sock: PUDPSocket): int = 
-  result = Net_AddSocket(theSet, cast[PNet_GenericSocket](sock))
+proc UDP_AddSocket(theSet: PSocketSet, sock: PUDPSocket): int = 
+  result = AddSocket(theSet, cast[PGenericSocket](sock))
 
-proc Net_TCP_DelSocket(theSet: PNet_SocketSet, sock: PTCPSocket): int = 
-  result = Net_DelSocket(theSet, cast[PNet_GenericSocket](sock))
+proc TCP_DelSocket(theSet: PSocketSet, sock: PTCPSocket): int = 
+  result = DelSocket(theSet, cast[PGenericSocket](sock))
 
-proc Net_UDP_DelSocket(theSet: PNet_SocketSet, sock: PUDPSocket): int = 
-  result = Net_DelSocket(theSet, cast[PNet_GenericSocket](sock))
+proc UDP_DelSocket(theSet: PSocketSet, sock: PUDPSocket): int = 
+  result = DelSocket(theSet, cast[PGenericSocket](sock))
 
-proc Net_SocketReady(sock: PNet_GenericSocket): bool = 
+proc SocketReady(sock: PGenericSocket): bool = 
   result = ((sock != nil) and (sock.ready == 1))
 
-proc Net_SetError(fmt: cstring) = 
-  SetError(fmt)
-
-proc Net_GetError(): cstring = 
-  result = GetError()
diff --git a/lib/newwrap/sdl/sdl_ttf.nim b/lib/newwrap/sdl/sdl_ttf.nim
index 410597317..bab48ec53 100755
--- a/lib/newwrap/sdl/sdl_ttf.nim
+++ b/lib/newwrap/sdl/sdl_ttf.nim
@@ -153,7 +153,7 @@
 #
 
 import 
-  
+  sdl
 
 when defined(windows): 
   const 
@@ -165,97 +165,88 @@ else:
   const 
     ttfLibName = "libSDL_ttf.so"
 const 
-  TTF_MAJOR_VERSION* = 2'i8
-  TTF_MINOR_VERSION* = 0'i8
-  TTF_PATCHLEVEL* = 8'i8      # Backwards compatibility
-  TTF_MAJOR_VERSION* = TTF_MAJOR_VERSION
-  TTF_MINOR_VERSION* = TTF_MINOR_VERSION
-  TTF_PATCHLEVEL* = TTF_PATCHLEVEL #*
-                                   #   Set and retrieve the font style
-                                   #   This font style is implemented by modifying the font glyphs, and
-                                   #   doesn't reflect any inherent properties of the truetype font file.
-                                   #*
-  TTF_STYLE_NORMAL* = 0x00000000
-  TTF_STYLE_BOLD* = 0x00000001
-  TTF_STYLE_ITALIC* = 0x00000002
-  TTF_STYLE_UNDERLINE* = 0x00000004 # ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark)
+  MAJOR_VERSION* = 2'i8
+  MINOR_VERSION* = 0'i8
+  PATCHLEVEL* = 8'i8      # Backwards compatibility
+
+  STYLE_NORMAL* = 0x00000000
+  STYLE_BOLD* = 0x00000001
+  STYLE_ITALIC* = 0x00000002
+  STYLE_UNDERLINE* = 0x00000004 # ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark)
   UNICODE_BOM_NATIVE* = 0x0000FEFF
   UNICODE_BOM_SWAPPED* = 0x0000FFFE
 
 type 
-  PTTF_Font* = ptr TTTF_font
-  TTTF_Font*{.final.} = object  # This macro can be used to fill a version structure with the compile-time
+  PFont* = ptr Tfont
+  TFont*{.final.} = object  # This macro can be used to fill a version structure with the compile-time
                                 #  version of the SDL_ttf library. 
 
-proc TTF_VERSION*(X: var Tversion)
-  # This function gets the version of the dynamically linked SDL_ttf library.
-  #     It should NOT be used to fill a version structure, instead you should use the
-  #     SDL_TTF_VERSION() macro. 
-proc TTF_Linked_Version*(): Pversion{.cdecl, importc: "TTF_Linked_Version", 
+
+proc Linked_Version*(): sdl.Pversion{.cdecl, importc: "TTF_Linked_Version", 
                                       dynlib: ttfLibName.}
   # This function tells the library whether UNICODE text is generally
   #   byteswapped.  A UNICODE BOM character in a string will override
   #   this setting for the remainder of that string.
   #
-proc TTF_ByteSwappedUNICODE*(swapped: int){.cdecl, 
+proc ByteSwappedUNICODE*(swapped: int){.cdecl, 
     importc: "TTF_ByteSwappedUNICODE", dynlib: ttfLibName.}
   #returns 0 on succes, -1 if error occurs
-proc TTF_Init*(): int{.cdecl, importc: "TTF_Init", dynlib: ttfLibName.}
+proc Init*(): int{.cdecl, importc: "TTF_Init", dynlib: ttfLibName.}
   #
   # Open a font file and create a font of the specified point size.
   # Some .fon fonts will have several sizes embedded in the file, so the
   # point size becomes the index of choosing which size.  If the value
   # is too high, the last indexed size will be the default.
   #
-proc TTF_OpenFont*(filename: cstring, ptsize: int): PTTF_Font{.cdecl, 
+proc OpenFont*(filename: cstring, ptsize: int): PFont{.cdecl, 
     importc: "TTF_OpenFont", dynlib: ttfLibName.}
-proc TTF_OpenFontIndex*(filename: cstring, ptsize: int, index: int32): PTTF_Font{.
+proc OpenFontIndex*(filename: cstring, ptsize: int, index: int32): PFont{.
     cdecl, importc: "TTF_OpenFontIndex", dynlib: ttfLibName.}
-proc TTF_OpenFontRW*(src: PRWops, freesrc: int, ptsize: int): PTTF_Font{.cdecl, 
+proc OpenFontRW*(src: PRWops, freesrc: int, ptsize: int): PFont{.cdecl, 
     importc: "TTF_OpenFontRW", dynlib: ttfLibName.}
-proc TTF_OpenFontIndexRW*(src: PRWops, freesrc: int, ptsize: int, index: int32): PTTF_Font{.
+proc OpenFontIndexRW*(src: PRWops, freesrc: int, ptsize: int, index: int32): PFont{.
     cdecl, importc: "TTF_OpenFontIndexRW", dynlib: ttfLibName.}
-proc TTF_GetFontStyle*(font: PTTF_Font): int{.cdecl, 
+proc GetFontStyle*(font: PFont): int{.cdecl, 
     importc: "TTF_GetFontStyle", dynlib: ttfLibName.}
-proc TTF_SetFontStyle*(font: PTTF_Font, style: int){.cdecl, 
+proc SetFontStyle*(font: PFont, style: int){.cdecl, 
     importc: "TTF_SetFontStyle", dynlib: ttfLibName.}
   # Get the total height of the font - usually equal to point size 
-proc TTF_FontHeight*(font: PTTF_Font): int{.cdecl, importc: "TTF_FontHeight", 
+proc FontHeight*(font: PFont): int{.cdecl, importc: "TTF_FontHeight", 
     dynlib: ttfLibName.}
   # Get the offset from the baseline to the top of the font
   #   This is a positive value, relative to the baseline.
   #
-proc TTF_FontAscent*(font: PTTF_Font): int{.cdecl, importc: "TTF_FontAscent", 
+proc FontAscent*(font: PFont): int{.cdecl, importc: "TTF_FontAscent", 
     dynlib: ttfLibName.}
   # Get the offset from the baseline to the bottom of the font
   #   This is a negative value, relative to the baseline.
   #
-proc TTF_FontDescent*(font: PTTF_Font): int{.cdecl, importc: "TTF_FontDescent", 
+proc FontDescent*(font: PFont): int{.cdecl, importc: "TTF_FontDescent", 
     dynlib: ttfLibName.}
   # Get the recommended spacing between lines of text for this font 
-proc TTF_FontLineSkip*(font: PTTF_Font): int{.cdecl, 
+proc FontLineSkip*(font: PFont): int{.cdecl, 
     importc: "TTF_FontLineSkip", dynlib: ttfLibName.}
   # Get the number of faces of the font 
-proc TTF_FontFaces*(font: PTTF_Font): int32{.cdecl, importc: "TTF_FontFaces", 
+proc FontFaces*(font: PFont): int32{.cdecl, importc: "TTF_FontFaces", 
     dynlib: ttfLibName.}
   # Get the font face attributes, if any 
-proc TTF_FontFaceIsFixedWidth*(font: PTTF_Font): int{.cdecl, 
+proc FontFaceIsFixedWidth*(font: PFont): int{.cdecl, 
     importc: "TTF_FontFaceIsFixedWidth", dynlib: ttfLibName.}
-proc TTF_FontFaceFamilyName*(font: PTTF_Font): cstring{.cdecl, 
+proc FontFaceFamilyName*(font: PFont): cstring{.cdecl, 
     importc: "TTF_FontFaceFamilyName", dynlib: ttfLibName.}
-proc TTF_FontFaceStyleName*(font: PTTF_Font): cstring{.cdecl, 
+proc FontFaceStyleName*(font: PFont): cstring{.cdecl, 
     importc: "TTF_FontFaceStyleName", dynlib: ttfLibName.}
   # Get the metrics (dimensions) of a glyph 
-proc TTF_GlyphMetrics*(font: PTTF_Font, ch: Uint16, minx: var int, 
+proc GlyphMetrics*(font: PFont, ch: Uint16, minx: var int, 
                        maxx: var int, miny: var int, maxy: var int, 
                        advance: var int): int{.cdecl, 
     importc: "TTF_GlyphMetrics", dynlib: ttfLibName.}
   # Get the dimensions of a rendered string of text 
-proc TTF_SizeText*(font: PTTF_Font, text: cstring, w: var int, y: var int): int{.
+proc SizeText*(font: PFont, text: cstring, w: var int, y: var int): int{.
     cdecl, importc: "TTF_SizeText", dynlib: ttfLibName.}
-proc TTF_SizeUTF8*(font: PTTF_Font, text: cstring, w: var int, y: var int): int{.
+proc SizeUTF8*(font: PFont, text: cstring, w: var int, y: var int): int{.
     cdecl, importc: "TTF_SizeUTF8", dynlib: ttfLibName.}
-proc TTF_SizeUNICODE*(font: PTTF_Font, text: PUint16, w: var int, y: var int): int{.
+proc SizeUNICODE*(font: PFont, text: PUint16, w: var int, y: var int): int{.
     cdecl, importc: "TTF_SizeUNICODE", dynlib: ttfLibName.}
   # Create an 8-bit palettized surface and render the given text at
   #   fast quality with the given font and color.  The 0 pixel is the
@@ -263,9 +254,9 @@ proc TTF_SizeUNICODE*(font: PTTF_Font, text: PUint16, w: var int, y: var int): i
   #   to the text color.
   #   This function returns the new surface, or NULL if there was an error.
   #
-proc TTF_RenderUTF8_Solid*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{.
+proc RenderUTF8_Solid*(font: PFont, text: cstring, fg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderUTF8_Solid", dynlib: ttfLibName.}
-proc TTF_RenderUNICODE_Solid*(font: PTTF_Font, text: PUint16, fg: TColor): PSurface{.
+proc RenderUNICODE_Solid*(font: PFont, text: PUint16, fg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderUNICODE_Solid", dynlib: ttfLibName.}
   #
   #Create an 8-bit palettized surface and render the given glyph at
@@ -275,20 +266,20 @@ proc TTF_RenderUNICODE_Solid*(font: PTTF_Font, text: PUint16, fg: TColor): PSurf
   #   centering in the X direction, and aligned normally in the Y direction.
   #   This function returns the new surface, or NULL if there was an error.
   #
-proc TTF_RenderGlyph_Solid*(font: PTTF_Font, ch: Uint16, fg: TColor): PSurface{.
+proc RenderGlyph_Solid*(font: PFont, ch: Uint16, fg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderGlyph_Solid", dynlib: ttfLibName.}
   # Create an 8-bit palettized surface and render the given text at
   #   high quality with the given font and colors.  The 0 pixel is background,
   #   while other pixels have varying degrees of the foreground color.
   #   This function returns the new surface, or NULL if there was an error.
   #
-proc TTF_RenderText_Shaded*(font: PTTF_Font, text: cstring, fg: TColor, 
+proc RenderText_Shaded*(font: PFont, text: cstring, fg: TColor, 
                             bg: TColor): PSurface{.cdecl, 
     importc: "TTF_RenderText_Shaded", dynlib: ttfLibName.}
-proc TTF_RenderUTF8_Shaded*(font: PTTF_Font, text: cstring, fg: TColor, 
+proc RenderUTF8_Shaded*(font: PFont, text: cstring, fg: TColor, 
                             bg: TColor): PSurface{.cdecl, 
     importc: "TTF_RenderUTF8_Shaded", dynlib: ttfLibName.}
-proc TTF_RenderUNICODE_Shaded*(font: PTTF_Font, text: PUint16, fg: TColor, 
+proc RenderUNICODE_Shaded*(font: PFont, text: PUint16, fg: TColor, 
                                bg: TColor): PSurface{.cdecl, 
     importc: "TTF_RenderUNICODE_Shaded", dynlib: ttfLibName.}
   # Create an 8-bit palettized surface and render the given glyph at
@@ -298,17 +289,17 @@ proc TTF_RenderUNICODE_Shaded*(font: PTTF_Font, text: PUint16, fg: TColor,
   #   direction, and aligned normally in the Y direction.
   #   This function returns the new surface, or NULL if there was an error.
   #
-proc TTF_RenderGlyph_Shaded*(font: PTTF_Font, ch: Uint16, fg: TColor, bg: TColor): PSurface{.
+proc RenderGlyph_Shaded*(font: PFont, ch: Uint16, fg: TColor, bg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderGlyph_Shaded", dynlib: ttfLibName.}
   # Create a 32-bit ARGB surface and render the given text at high quality,
   #   using alpha blending to dither the font with the given color.
   #   This function returns the new surface, or NULL if there was an error.
   #
-proc TTF_RenderText_Blended*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{.
+proc RenderText_Blended*(font: PFont, text: cstring, fg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderText_Blended", dynlib: ttfLibName.}
-proc TTF_RenderUTF8_Blended*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{.
+proc RenderUTF8_Blended*(font: PFont, text: cstring, fg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderUTF8_Blended", dynlib: ttfLibName.}
-proc TTF_RenderUNICODE_Blended*(font: PTTF_Font, text: PUint16, fg: TColor): PSurface{.
+proc RenderUNICODE_Blended*(font: PFont, text: PUint16, fg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderUNICODE_Blended", dynlib: ttfLibName.}
   # Create a 32-bit ARGB surface and render the given glyph at high quality,
   #   using alpha blending to dither the font with the given color.
@@ -316,7 +307,7 @@ proc TTF_RenderUNICODE_Blended*(font: PTTF_Font, text: PUint16, fg: TColor): PSu
   #   direction, and aligned normally in the Y direction.
   #   This function returns the new surface, or NULL if there was an error.
   #
-proc TTF_RenderGlyph_Blended*(font: PTTF_Font, ch: Uint16, fg: TColor): PSurface{.
+proc RenderGlyph_Blended*(font: PFont, ch: Uint16, fg: TColor): PSurface{.
     cdecl, importc: "TTF_RenderGlyph_Blended", dynlib: ttfLibName.}
   # For compatibility with previous versions, here are the old functions 
   ##define TTF_RenderText(font, text, fg, bg)
@@ -326,32 +317,25 @@ proc TTF_RenderGlyph_Blended*(font: PTTF_Font, ch: Uint16, fg: TColor): PSurface
   ##define TTF_RenderUNICODE(font, text, fg, bg)	
   #	TTF_RenderUNICODE_Shaded(font, text, fg, bg)
   # Close an opened font file 
-proc TTF_CloseFont*(font: PTTF_Font){.cdecl, importc: "TTF_CloseFont", 
+proc CloseFont*(font: PFont){.cdecl, importc: "TTF_CloseFont", 
                                       dynlib: ttfLibName.}
   #De-initialize TTF engine
-proc TTF_Quit*(){.cdecl, importc: "TTF_Quit", dynlib: ttfLibName.}
+proc Quit*(){.cdecl, importc: "TTF_Quit", dynlib: ttfLibName.}
   # Check if the TTF engine is initialized
-proc TTF_WasInit*(): int{.cdecl, importc: "TTF_WasInit", dynlib: ttfLibName.}
-  # We'll use SDL for reporting errors
-proc TTF_SetError*(fmt: cstring)
-proc TTF_GetError*(): cstring
-# implementation
+proc WasInit*(): int{.cdecl, importc: "TTF_WasInit", dynlib: ttfLibName.}
 
-proc TTF_VERSION(X: var Tversion) = 
-  X.major = TTF_MAJOR_VERSION
-  X.minor = TTF_MINOR_VERSION
-  X.patch = TTF_PATCHLEVEL
 
-proc TTF_SetError(fmt: cstring) = 
-  SetError(fmt)
+proc VERSION*(X: var sdl.Tversion) = 
+  X.major = MAJOR_VERSION
+  X.minor = MINOR_VERSION
+  X.patch = PATCHLEVEL
 
-proc TTF_GetError(): cstring = 
-  result = GetError()
 
-when not (defined(Workaround_TTF_RenderText_Solid)): 
-  proc TTF_RenderText_Solid*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{.
+when not (defined(Workaround_RenderText_Solid)): 
+  proc RenderText_Solid*(font: PFont, text: cstring, fg: TColor): PSurface{.
       cdecl, importc: "TTF_RenderText_Solid", dynlib: ttfLibName.}
 else: 
-  proc TTF_RenderText_Solid(font: PTTF_Font, text: cstring, fg: TColor): PSurface = 
+  proc RenderText_Solid(font: PFont, text: cstring, fg: TColor): PSurface = 
     var Black: TColor         # initialized to zero
-    Result = TTF_RenderText_Shaded(font, text, fg, Black)
+    result = RenderText_Shaded(font, text, fg, Black)
+
diff --git a/lib/newwrap/sdl/smpeg.nim b/lib/newwrap/sdl/smpeg.nim
index 5c9562201..b8de2e70c 100755
--- a/lib/newwrap/sdl/smpeg.nim
+++ b/lib/newwrap/sdl/smpeg.nim
@@ -126,7 +126,7 @@
 #******************************************************************************
 
 import 
-  
+  sdl
 
 when defined(windows): 
   const 
@@ -138,57 +138,53 @@ else:
   const 
     SmpegLibName = "libsmpeg.so"
 const 
-  SMPEG_FILTER_INFO_MB_ERROR* = 1
-  SMPEG_FILTER_INFO_PIXEL_ERROR* = 2 # Filter info from SMPEG 
+  FILTER_INFO_MB_ERROR* = 1
+  FILTER_INFO_PIXEL_ERROR* = 2 # Filter info from SMPEG 
 
 type 
-  SMPEG_FilterInfo*{.final.} = object 
+  TFilterInfo*{.final.} = object 
     yuv_mb_square_error*: PUint16
     yuv_pixel_square_error*: PUint16
 
-  TSMPEG_FilterInfo* = SMPEG_FilterInfo
-  PSMPEG_FilterInfo* = ptr SMPEG_FilterInfo # MPEG filter definition 
-  PSMPEG_Filter* = ptr TSMPEG_Filter # Callback functions for the filter 
-  TSMPEG_FilterCallback* = proc (dest, source: POverlay, region: PRect, 
-                                 filter_info: PSMPEG_FilterInfo, data: Pointer): Pointer{.
+  PFilterInfo* = ptr TFilterInfo # MPEG filter definition 
+  PFilter* = ptr TFilter # Callback functions for the filter 
+  TFilterCallback* = proc (dest, source: POverlay, region: PRect, 
+                                 filter_info: PFilterInfo, data: Pointer): Pointer{.
       cdecl.}
-  TSMPEG_FilterDestroy* = proc (Filter: PSMPEG_Filter): Pointer{.cdecl.} # The filter 
-                                                                         # 
-                                                                         # definition itself 
-  TSMPEG_Filter*{.final.} = object  # The null filter (default). It simply copies the source rectangle to the video overlay. 
+  TFilterDestroy* = proc (Filter: PFilter): Pointer{.cdecl.} # The filter definition itself 
+  TFilter*{.final.} = object  # The null filter (default). It simply copies the source rectangle to the video overlay. 
     flags*: Uint32
     data*: Pointer
-    callback*: TSMPEG_FilterCallback
-    destroy*: TSMPEG_FilterDestroy
+    callback*: TFilterCallback
+    destroy*: TFilterDestroy
 
 
-proc SMPEGfilter_null*(): PSMPEG_Filter{.cdecl, importc: "SMPEGfilter_null", 
+proc filter_null*(): PFilter{.cdecl, importc: "SMPEGfilter_null", 
     dynlib: SmpegLibName.}
   # The bilinear filter. A basic low-pass filter that will produce a smoother image. 
-proc SMPEGfilter_bilinear*(): PSMPEG_Filter{.cdecl, 
+proc filter_bilinear*(): PFilter{.cdecl, 
     importc: "SMPEGfilter_bilinear", dynlib: SmpegLibName.}
   # The deblocking filter. It filters block borders and non-intra coded blocks to reduce blockiness 
-proc SMPEGfilter_deblocking*(): PSMPEG_Filter{.cdecl, 
+proc filter_deblocking*(): PFilter{.cdecl, 
     importc: "SMPEGfilter_deblocking", dynlib: SmpegLibName.}
   #------------------------------------------------------------------------------
   # SMPEG.h
   #------------------------------------------------------------------------------
 const 
-  SMPEG_MAJOR_VERSION* = 0'i8
-  SMPEG_MINOR_VERSION* = 4'i8
-  SMPEG_PATCHLEVEL* = 2'i8
+  MAJOR_VERSION* = 0'i8
+  MINOR_VERSION* = 4'i8
+  PATCHLEVEL* = 2'i8
 
 type 
-  SMPEG_version*{.final.} = object 
+  TVersion*{.final.} = object 
     major*: UInt8
     minor*: UInt8
     patch*: UInt8
 
-  TSMPEG_version* = SMPEG_version
-  PSMPEG_version* = ptr TSMPEG_version # This is the actual SMPEG object
+  Pversion* = ptr Tversion # This is the actual SMPEG object
   TSMPEG*{.final.} = object 
   PSMPEG* = ptr TSMPEG        # Used to get information about the SMPEG object 
-  TSMPEG_Info*{.final.} = object 
+  TInfo*{.final.} = object 
     has_audio*: int
     has_video*: int
     width*: int
@@ -202,138 +198,138 @@ type
     current_time*: float64
     total_time*: float64
 
-  PSMPEG_Info* = ptr TSMPEG_Info # Possible MPEG status codes 
+  PInfo* = ptr TInfo # Possible MPEG status codes 
 
 const 
-  STATUS_SMPEG_ERROR* = - 1
-  STATUS_SMPEG_STOPPED* = 0
-  STATUS_SMPEG_PLAYING* = 1
+  STATUS_ERROR* = - 1
+  STATUS_STOPPED* = 0
+  STATUS_PLAYING* = 1
 
 type 
-  TSMPEGstatus* = int
-  PSMPEGstatus* = ptr int     # Matches the declaration of SDL_UpdateRect() 
-  TSMPEG_DisplayCallback* = proc (dst: PSurface, x, y: int, w, h: int): Pointer{.
+  Tstatus* = int
+  Pstatus* = ptr int     # Matches the declaration of SDL_UpdateRect() 
+  TDisplayCallback* = proc (dst: PSurface, x, y: int, w, h: int): Pointer{.
       cdecl.} # Create a new SMPEG object from an MPEG file.
               #  On return, if 'info' is not NULL, it will be filled with information
               #  about the MPEG object.
-              #  This function returns a new SMPEG object.  Use SMPEG_error() to find out
+              #  This function returns a new SMPEG object.  Use error() to find out
               #  whether or not there was a problem building the MPEG stream.
               #  The sdl_audio parameter indicates if SMPEG should initialize the SDL audio
-              #  subsystem. If not, you will have to use the SMPEG_playaudio() function below
+              #  subsystem. If not, you will have to use the playaudio() function below
               #  to extract the decoded data. 
 
-proc SMPEG_new*(theFile: cstring, info: PSMPEG_Info, audio: int): PSMPEG{.cdecl, 
+proc SMPEG_new*(theFile: cstring, info: PInfo, audio: int): PSMPEG{.cdecl, 
     importc: "SMPEG_new", dynlib: SmpegLibName.}
   # The same as above for a file descriptor 
-proc SMPEG_new_descr*(theFile: int, info: PSMPEG_Info, audio: int): PSMPEG{.
+proc new_descr*(theFile: int, info: PInfo, audio: int): PSMPEG{.
     cdecl, importc: "SMPEG_new_descr", dynlib: SmpegLibName.}
   #  The same as above but for a raw chunk of data.  SMPEG makes a copy of the
   #   data, so the application is free to delete after a successful call to this
   #   function. 
-proc SMPEG_new_data*(data: Pointer, size: int, info: PSMPEG_Info, audio: int): PSMPEG{.
+proc new_data*(data: Pointer, size: int, info: PInfo, audio: int): PSMPEG{.
     cdecl, importc: "SMPEG_new_data", dynlib: SmpegLibName.}
   # Get current information about an SMPEG object 
-proc SMPEG_getinfo*(mpeg: PSMPEG, info: PSMPEG_Info){.cdecl, 
+proc getinfo*(mpeg: PSMPEG, info: PInfo){.cdecl, 
     importc: "SMPEG_getinfo", dynlib: SmpegLibName.}
-  #procedure SMPEG_getinfo(mpeg: PSMPEG; info: Pointer);
+  #procedure getinfo(mpeg: PSMPEG; info: Pointer);
   #cdecl; external  SmpegLibName;
   # Enable or disable audio playback in MPEG stream 
-proc SMPEG_enableaudio*(mpeg: PSMPEG, enable: int){.cdecl, 
+proc enableaudio*(mpeg: PSMPEG, enable: int){.cdecl, 
     importc: "SMPEG_enableaudio", dynlib: SmpegLibName.}
   # Enable or disable video playback in MPEG stream 
-proc SMPEG_enablevideo*(mpeg: PSMPEG, enable: int){.cdecl, 
+proc enablevideo*(mpeg: PSMPEG, enable: int){.cdecl, 
     importc: "SMPEG_enablevideo", dynlib: SmpegLibName.}
   # Delete an SMPEG object 
-proc SMPEG_delete*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_delete", 
+proc delete*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_delete", 
                                   dynlib: SmpegLibName.}
   # Get the current status of an SMPEG object 
-proc SMPEG_status*(mpeg: PSMPEG): TSMPEGstatus{.cdecl, importc: "SMPEG_status", 
+proc status*(mpeg: PSMPEG): Tstatus{.cdecl, importc: "SMPEG_status", 
     dynlib: SmpegLibName.}
   # status
   # Set the audio volume of an MPEG stream, in the range 0-100 
-proc SMPEG_setvolume*(mpeg: PSMPEG, volume: int){.cdecl, 
+proc setvolume*(mpeg: PSMPEG, volume: int){.cdecl, 
     importc: "SMPEG_setvolume", dynlib: SmpegLibName.}
   # Set the destination surface for MPEG video playback
   #  'surfLock' is a mutex used to synchronize access to 'dst', and can be NULL.
   #  'callback' is a function called when an area of 'dst' needs to be updated.
   #  If 'callback' is NULL, the default function (SDL_UpdateRect) will be used. 
-proc SMPEG_setdisplay*(mpeg: PSMPEG, dst: PSurface, surfLock: Pmutex, 
-                       callback: TSMPEG_DisplayCallback){.cdecl, 
+proc setdisplay*(mpeg: PSMPEG, dst: PSurface, surfLock: Pmutex, 
+                       callback: TDisplayCallback){.cdecl, 
     importc: "SMPEG_setdisplay", dynlib: SmpegLibName.}
   # Set or clear looping play on an SMPEG object 
-proc SMPEG_loop*(mpeg: PSMPEG, repeat_: int){.cdecl, importc: "SMPEG_loop", 
+proc loop*(mpeg: PSMPEG, repeat_: int){.cdecl, importc: "SMPEG_loop", 
     dynlib: SmpegLibName.}
   # Scale pixel display on an SMPEG object 
-proc SMPEG_scaleXY*(mpeg: PSMPEG, width, height: int){.cdecl, 
+proc scaleXY*(mpeg: PSMPEG, width, height: int){.cdecl, 
     importc: "SMPEG_scaleXY", dynlib: SmpegLibName.}
-proc SMPEG_scale*(mpeg: PSMPEG, scale: int){.cdecl, importc: "SMPEG_scale", 
+proc scale*(mpeg: PSMPEG, scale: int){.cdecl, importc: "SMPEG_scale", 
     dynlib: SmpegLibName.}
-proc SMPEG_Double*(mpeg: PSMPEG, doubleit: bool)
+proc Double*(mpeg: PSMPEG, doubleit: bool)
   # Move the video display area within the destination surface 
-proc SMPEG_move*(mpeg: PSMPEG, x, y: int){.cdecl, importc: "SMPEG_move", 
+proc move*(mpeg: PSMPEG, x, y: int){.cdecl, importc: "SMPEG_move", 
     dynlib: SmpegLibName.}
   # Set the region of the video to be shown 
-proc SMPEG_setdisplayregion*(mpeg: PSMPEG, x, y, w, h: int){.cdecl, 
+proc setdisplayregion*(mpeg: PSMPEG, x, y, w, h: int){.cdecl, 
     importc: "SMPEG_setdisplayregion", dynlib: SmpegLibName.}
   # Play an SMPEG object 
-proc SMPEG_play*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_play", 
+proc play*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_play", 
                                 dynlib: SmpegLibName.}
   # Pause/Resume playback of an SMPEG object
-proc SMPEG_pause*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_pause", 
+proc pause*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_pause", 
                                  dynlib: SmpegLibName.}
   # Stop playback of an SMPEG object 
-proc SMPEG_stop*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_stop", 
+proc stop*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_stop", 
                                 dynlib: SmpegLibName.}
   # Rewind the play position of an SMPEG object to the beginning of the MPEG 
-proc SMPEG_rewind*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_rewind", 
+proc rewind*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_rewind", 
                                   dynlib: SmpegLibName.}
   # Seek 'bytes' bytes in the MPEG stream 
-proc SMPEG_seek*(mpeg: PSMPEG, bytes: int){.cdecl, importc: "SMPEG_seek", 
+proc seek*(mpeg: PSMPEG, bytes: int){.cdecl, importc: "SMPEG_seek", 
     dynlib: SmpegLibName.}
   # Skip 'seconds' seconds in the MPEG stream 
-proc SMPEG_skip*(mpeg: PSMPEG, seconds: float32){.cdecl, importc: "SMPEG_skip", 
+proc skip*(mpeg: PSMPEG, seconds: float32){.cdecl, importc: "SMPEG_skip", 
     dynlib: SmpegLibName.}
   # Render a particular frame in the MPEG video
   #   API CHANGE: This function no longer takes a target surface and position.
-  #               Use SMPEG_setdisplay() and SMPEG_move() to set this information. 
-proc SMPEG_renderFrame*(mpeg: PSMPEG, framenum: int){.cdecl, 
+  #               Use setdisplay() and move() to set this information. 
+proc renderFrame*(mpeg: PSMPEG, framenum: int){.cdecl, 
     importc: "SMPEG_renderFrame", dynlib: SmpegLibName.}
   # Render the last frame of an MPEG video 
-proc SMPEG_renderFinal*(mpeg: PSMPEG, dst: PSurface, x, y: int){.cdecl, 
+proc renderFinal*(mpeg: PSMPEG, dst: PSurface, x, y: int){.cdecl, 
     importc: "SMPEG_renderFinal", dynlib: SmpegLibName.}
   # Set video filter 
-proc SMPEG_filter*(mpeg: PSMPEG, filter: PSMPEG_Filter): PSMPEG_Filter{.cdecl, 
+proc filter*(mpeg: PSMPEG, filter: PFilter): PFilter{.cdecl, 
     importc: "SMPEG_filter", dynlib: SmpegLibName.}
   # Return NULL if there is no error in the MPEG stream, or an error message
   #   if there was a fatal error in the MPEG stream for the SMPEG object. 
-proc SMPEG_error*(mpeg: PSMPEG): cstring{.cdecl, importc: "SMPEG_error", 
+proc error*(mpeg: PSMPEG): cstring{.cdecl, importc: "SMPEG_error", 
     dynlib: SmpegLibName.}
   # Exported callback function for audio playback.
   #   The function takes a buffer and the amount of data to fill, and returns
   #   the amount of data in bytes that was actually written.  This will be the
   #   amount requested unless the MPEG audio has finished.
   #
-proc SMPEG_playAudio*(mpeg: PSMPEG, stream: PUInt8, length: int): int{.cdecl, 
+proc playAudio*(mpeg: PSMPEG, stream: PUInt8, length: int): int{.cdecl, 
     importc: "SMPEG_playAudio", dynlib: SmpegLibName.}
-  # Wrapper for SMPEG_playAudio() that can be passed to SDL and SDL_mixer 
-proc SMPEG_playAudioSDL*(mpeg: Pointer, stream: PUInt8, length: int){.cdecl, 
+  # Wrapper for playAudio() that can be passed to SDL and SDL_mixer 
+proc playAudioSDL*(mpeg: Pointer, stream: PUInt8, length: int){.cdecl, 
     importc: "SMPEG_playAudioSDL", dynlib: SmpegLibName.}
   # Get the best SDL audio spec for the audio stream 
-proc SMPEG_wantedSpec*(mpeg: PSMPEG, wanted: PAudioSpec): int{.cdecl, 
+proc wantedSpec*(mpeg: PSMPEG, wanted: PAudioSpec): int{.cdecl, 
     importc: "SMPEG_wantedSpec", dynlib: SmpegLibName.}
   # Inform SMPEG of the actual SDL audio spec used for sound playback 
-proc SMPEG_actualSpec*(mpeg: PSMPEG, spec: PAudioSpec){.cdecl, 
+proc actualSpec*(mpeg: PSMPEG, spec: PAudioSpec){.cdecl, 
     importc: "SMPEG_actualSpec", dynlib: SmpegLibName.}
   # This macro can be used to fill a version structure with the compile-time
   #  version of the SDL library. 
-proc SMPEG_GETVERSION*(X: var TSMPEG_version)
+proc GETVERSION*(X: var Tversion)
 # implementation
 
-proc SMPEG_double(mpeg: PSMPEG, doubleit: bool) = 
-  if doubleit: SMPEG_scale(mpeg, 2)
-  else: SMPEG_scale(mpeg, 1)
+proc double(mpeg: PSMPEG, doubleit: bool) = 
+  if doubleit: scale(mpeg, 2)
+  else: scale(mpeg, 1)
   
-proc SMPEG_GETVERSION(X: var TSMPEG_version) = 
-  X.major = SMPEG_MAJOR_VERSION
-  X.minor = SMPEG_MINOR_VERSION
-  X.patch = SMPEG_PATCHLEVEL
+proc GETVERSION(X: var Tversion) = 
+  X.major = MAJOR_VERSION
+  X.minor = MINOR_VERSION
+  X.patch = PATCHLEVEL