made xlib wrapper more typesafe #20