diff --git a/vapi/x11.vapi b/vapi/x11.vapi
index 1a631a7..8a085d9 100644
--- a/vapi/x11.vapi
+++ b/vapi/x11.vapi
@@ -28,7 +28,7 @@ namespace X {
 	public Status init_threads ();
 
 	[Compact]
-	[CCode (cname = "Display", ref_function = "", unref_function = "")]
+	[CCode (cname = "Display", free_function = "XCloseDisplay")]
 	public class Display {
 		[CCode (cname = "XOpenDisplay")]
 		public Display (string? name = null);
@@ -66,6 +66,9 @@ namespace X {
 		[CCode (cname = "ConnectionNumber")]
 		public int connection_number ();
 
+		[CCode (cname = "XCreateWindow")]
+		public Window create_window(Window parent, int x, int y, uint width, uint height, uint border_width, int depth, WindowClass window_class, Visual? visual, CW value_mask, ref SetWindowAttributes attribs);
+
 		[CCode (cname = "DefaultRootWindow")]
 		public Window default_root_window ();
 
@@ -144,6 +147,9 @@ namespace X {
 		[CCode (cname = "XMapWindow")]
 		public int map_window (Window w);
 
+		[CCode (cname = "XMapRaised")]
+		public int map_raised (Window w);
+
 		[CCode (cname = "XMaxRequestSize")]
 		public long max_request_size ();
 
@@ -190,13 +196,13 @@ namespace X {
 		public int resize_window (Window w, uint width, uint height);
 
 		[CCode (cname = "XRootWindow")]
-		public Window root_window (int screen_number);
+		public Window get_root_window (int screen_number);
 
 		[CCode (cname = "ScreenCount")]
-		public int screen_count ();
+		public int get_screen_count ();
 
 		[CCode (cname = "XScreenOfDisplay")]
-		public unowned Screen screen_of_display (int screen_number);
+		public unowned Screen get_screen (int screen_number);
 
 		[CCode (cname = "XSelectInput")]
 		public int select_input (Window w, long event_mask);
@@ -321,6 +327,13 @@ namespace X {
 	public struct Pixmap : Drawable	{
 	}
 
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cname = "Visual", type_id = "G_TYPE_INT",
+		marshaller_type_name = "INT",
+		get_value_function = "g_value_get_int",
+		set_value_function = "g_value_set_int", default_value = "0",
+		type_signature = "i")]
 	public struct Visual {
 	}
 
@@ -341,9 +354,6 @@ namespace X {
 		public int height;
 	}
 
-	[CCode (cname = "XCreateWindow")]
-	public Window create_window (Display display, Window parent, int x, int y, uint width, uint height, uint border_width, int depth, uint @class, Visual? visual, X.CW valuemask, ref SetWindowAttributes attributes);
-
 	[CCode (cname = "XSetWindowAttributes")]
 	public struct SetWindowAttributes {
 		// public Pixmap background_pixmap;	/* background or None or ParentRelative */
@@ -397,121 +407,261 @@ namespace X {
 	[CCode (cname = "CurrentTime")]
 	public const ulong CURRENT_TIME;
 
-	[CCode (cname = "Success")]
-	public int Success;
-
 	[CCode (cname = "XFree")]
 	public int free (void* data);
 
-	[CCode (cprefix = "CW", cname = "int")]
+	[CCode (cprefix = "", cname = "int")]
+	public enum ErrorCode {
+		[CCode (cname = "Success")]
+		SUCCESS,
+		[CCode (cname = "BadRequest")]
+		BAD_REQUEST,
+		[CCode (cname = "BadValue")]
+		BAD_VALUE,
+		[CCode (cname = "BadWindow")]
+		BAD_WINDOW,
+		[CCode (cname = "BadPixmap")]
+		BAD_PIXMAP,
+		[CCode (cname = "BadAtom")]
+		BAD_ATOM,
+		[CCode (cname = "BadCursor")]
+		BAD_CURSOR,
+		[CCode (cname = "BadFont")]
+		BAD_FONT,
+		[CCode (cname = "BadMatch")]
+		BAD_MATCH,
+		[CCode (cname = "BadDrawable")]
+		BAD_DRAWABLE,
+		[CCode (cname = "BadAccess")]
+		BAD_ACCESS,
+		[CCode (cname = "BadAlloc")]
+		BAD_ALLOC,
+		[CCode (cname = "BadColor")]
+		BAD_COLOR,
+		[CCode (cname = "BadGC")]
+		BAD_GC,
+		[CCode (cname = "BadIDChoice")]
+		BAD_ID_CHOICE,
+		[CCode (cname = "BadName")]
+		BAD_NAME,
+		[CCode (cname = "BadLength")]
+		BAD_LENGTH,
+		[CCode (cname = "BadImplementation")]
+		BAD_IMPLEMENTATION,
+		[CCode (cname = "FirstExtensionError")]
+		FIRST_EXTENSION_ERROR,
+		[CCode (cname = "LastExtensionError")]
+		LAST_EXTENSION_ERROR
+	}
+
+	[CCode (cprefix = "", cname = "int")]
+	public enum WindowClass {
+		[CCode (cname = "InputOutput")]
+		INPUT_OUTPUT,
+		[CCode (cname = "InputOnly")]
+		INPUT_ONLY
+	}
+
+	[CCode (cname = "int")]
 	public enum CW {
-		BackPixmap,
-		BackPixel,
-		BackingStore,
-		BackingPlanes,
-		BackingPixel,
-		BitGravity,
-		BorderPixmap,
-		BorderPixel,
-		BorderWidth,
-		Colormap,
-		Cursor,
-		DontPropagate,
-		EventMask,
-		Height,
-		OverrideRedirect,
-		SaveUnder,
-		Sibling,
-		StackMode,
+		[CCode (cname = "CWBackPixmap")]
+		BACK_PIXMAP,
+		[CCode (cname = "CWBackPixel")]
+		BACK_PIXEL,
+		[CCode (cname = "CWBackingStore")]
+		BACKING_STORE,
+		[CCode (cname = "CWBackingPlanes")]
+		BACKING_PLANES,
+		[CCode (cname = "CWBackingPixel")]
+		BACKING_PIXEL,
+		[CCode (cname = "CWBitGravity")]
+		BIT_GRAVITY,
+		[CCode (cname = "CWBorderPixmap")]
+		BORDER_PIXMAP,
+		[CCode (cname = "CWBorderPixel")]
+		BORDER_PIXEL,
+		[CCode (cname = "CWBorderWidth")]
+		BORDER_WIDTH,
+		[CCode (cname = "CWColormap")]
+		COLORMAP,
+		[CCode (cname = "CWCursor")]
+		CURSOR,
+		[CCode (cname = "CWDontPropagate")]
+		DONT_PROPAGATE,
+		[CCode (cname = "CWEventMask")]
+		EVENT_MASK,
+		[CCode (cname = "CWHeight")]
+		HEIGHT,
+		[CCode (cname = "CWOverrideRedirect")]
+		OVERRIDE_REDIRECT,
+		[CCode (cname = "CWSaveUnder")]
+		SAVE_UNDER,
+		[CCode (cname = "CWSibling")]
+		SIBLING,
+		[CCode (cname = "CWStackMode")]
+		STACK_MODE,
+		[CCode (cname = "CWX")]
 		X,
+		[CCode (cname = "CWY")]
 		Y,
-		Width,
-		WinGravity
+		[CCode (cname = "CWWidth")]
+		WIDTH,
+		[CCode (cname = "CWWinGravity")]
+		WIN_GRAVITY
 	}
 
 	[CCode (cprefix = "GrabMode")]
 	public enum GrabMode {
-		Sync,
-		Async
+		[CCode (cname = "Sync")]
+		SYNC,
+		[CCode (cname = "Async")]
+		ASYNC
 	}
 
 	[CCode (cprefix = "")]
 	public enum EventMask {
-		NoEventMask,
-		KeyPressMask,
-		KeyReleaseMask,
-		ButtonPressMask,
-		ButtonReleaseMask,
-		EnterWindowMask,
-		LeaveWindowMask,
-		PointerMotionMask,
-		PointerMotionHintMask,
-		Button1MotionMask,
-		Button2MotionMask,
-		Button3MotionMask,
-		Button4MotionMask,
-		Button5MotionMask,
-		ButtonMotionMask,
-		KeymapStateMask,
-		ExposureMask,
-		VisibilityChangeMask,
-		StructureNotifyMask,
-		ResizeRedirectMask,
-		SubstructureNotifyMask,
-		SubstructureRedirectMask,
-		FocusChangeMask,
-		PropertyChangeMask,
-		ColormapChangeMask,
-		OwnerGrabButtonMask
+		[CCode (cname = "NoEventMask")]
+		NO_EVENT_MASK,
+		[CCode (cname = "KeyPressMask")]
+		KEY_PRESS_MASK,
+		[CCode (cname = "KeyReleaseMask")]
+		KEY_RELEASE_MASK,
+		[CCode (cname = "ButtonPressMask")]
+		BUTTON_PRESS_MASK,
+		[CCode (cname = "ButtonReleaseMask")]
+		BUTTON_RELEASE_MASK,
+		[CCode (cname = "EnterWindowMask")]
+		ENTER_WINDOW_MASK,
+		[CCode (cname = "LeaveWindowMask")]
+		LEAVE_WINDOW_MASK,
+		[CCode (cname = "PointerMotionMask")]
+		POINTER_MOTION_MASK,
+		[CCode (cname = "PointerMotionHintMask")]
+		POINTER_MOTION_HINT_MASK,
+		[CCode (cname = "Button1MotionMask")]
+		BUTTON1_MOTION_MASK,
+		[CCode (cname = "Button2MotionMask")]
+		BUTTON2_MOTION_MASK,
+		[CCode (cname = "Button3MotionMask")]
+		BUTTON3_MOTION_MASK,
+		[CCode (cname = "Button4MotionMask")]
+		BUTTON4_MOTION_MASK,
+		[CCode (cname = "Button5MotionMask")]
+		BUTTON5_MOTION_MASK,
+		[CCode (cname = "ButtonMotionMask")]
+		BUTTON_MOTION_MASK,
+		[CCode (cname = "KeymapStateMask")]
+		KEYMAP_STATE_MASK,
+		[CCode (cname = "ExposureMask")]
+		EXPOSURE_MASK,
+		[CCode (cname = "VisibilityChangeMask")]
+		VISIBILITY_CHANGE_MASK,
+		[CCode (cname = "StructureNotifyMask")]
+		STRUCTURE_NOTIFY_MASK,
+		[CCode (cname = "ResizeRedirectMask")]
+		RESIZE_REDIRECT_MASK,
+		[CCode (cname = "SubstructureNotifyMask")]
+		SUBSTRUCTURE_NOTIFY_MASK,
+		[CCode (cname = "SubstructureRedirectMask")]
+		SUBSTRUCTURE_REDIRECT_MASK,
+		[CCode (cname = "FocusChangeMask")]
+		FOCUS_CHANGE_MASK,
+		[CCode (cname = "PropertyChangeMask")]
+		PROPERTY_CHANGE_MASK,
+		[CCode (cname = "ColormapChangeMask")]
+		COLORMAP_CHANGE_MASK,
+		[CCode (cname = "OwnerGrabButtonMask")]
+		OWNER_GRAB_BUTTON_MASK
 	}
 
 	[CCode (cprefix = "")]
 	public enum KeyMask {
-		ShiftMask,
-		LockMask,
-		ControlMask,
-		Mod1Mask,
-		Mod2Mask,
-		Mod3Mask,
-		Mod4Mask,
-		Mod5Mask
+		[CCode (cname = "ShiftMask")]
+		SHIFT_MASK,
+		[CCode (cname = "LockMask")]
+		LOCK_MASK,
+		[CCode (cname = "ControlMask")]
+		CONTROL_MASK,
+		[CCode (cname = "Mod1Mask")]
+		MOD1_MASK,
+		[CCode (cname = "Mod2Mask")]
+		MOD2_MASK,
+		[CCode (cname = "Mod3Mask")]
+		MOD3_MASK,
+		[CCode (cname = "Mod4Mask")]
+		MOD4_MASK,
+		[CCode (cname = "Mod5Mask")]
+		MOD5_MASK
 	}
 
 	[CCode (cprefix = "")]
 	public enum EventType {
-		KeyPress,
-		KeyRelease,
-		ButtonPress,
-		ButtonRelease,
-		MotionNotify,
-		EnterNotify,
-		LeaveNotify,
-		FocusIn,
-		FocusOut,
-		KeymapNotify,
-		Expose,
-		GraphicsExpose,
-		NoExpose,
-		VisibilityNotify,
-		CreateNotify,
-		DestroyNotify,
-		UnmapNotify,
-		MapNotify,
-		MapRequest,
-		ReparentNotify,
-		ConfigureNotify,
-		ConfigureRequest,
-		GravityNotify,
-		ResizeRequest,
-		CirculateNotify,
-		CirculateRequest,
-		PropertyNotify,
-		SelectionClear,
-		SelectionRequest,
-		SelectionNotify,
-		ColormapNotify,
-		ClientMessage,
-		MappingNotify
+		[CCode (cname = "KeyPress")]
+		KEY_PRESS,
+		[CCode (cname = "KeyRelease")]
+		KEY_RELEASE,
+		[CCode (cname = "ButtonPress")]
+		BUTTON_PRESS,
+		[CCode (cname = "ButtonRelease")]
+		BUTTON_RELEASE,
+		[CCode (cname = "MotionNotify")]
+		MOTION_NOTIFY,
+		[CCode (cname = "EnterNotify")]
+		ENTER_NOTIFY,
+		[CCode (cname = "LeaveNotify")]
+		LEAVE_NOTIFY,
+		[CCode (cname = "FocusIn")]
+		FOCUS_IN,
+		[CCode (cname = "FocusOut")]
+		FOCUS_OUT,
+		[CCode (cname = "KeymapNotify")]
+		KEYMAP_NOTIFY,
+		[CCode (cname = "Expose")]
+		EXPOSE,
+		[CCode (cname = "GraphicsExpose")]
+		GRAPHICS_EXPOSE,
+		[CCode (cname = "NoExpose")]
+		NO_EXPOSE,
+		[CCode (cname = "VisibilityNotify")]
+		VISIBILITY_NOTIFY,
+		[CCode (cname = "CreateNotify")]
+		CREATE_NOTIFY,
+		[CCode (cname = "DestroyNotify")]
+		DESTROY_NOTIFY,
+		[CCode (cname = "UnmapNotify")]
+		UNMAP_NOTIFY,
+		[CCode (cname = "MapNotify")]
+		MAP_NOTIFY,
+		[CCode (cname = "MapRequest")]
+		MAP_REQUEST,
+		[CCode (cname = "ReparentNotify")]
+		REPARENT_NOTIFY,
+		[CCode (cname = "ConfigureNotify")]
+		CONFIGURE_NOTIFY,
+		[CCode (cname = "ConfigureRequest")]
+		CONFIGURE_REQUEST,
+		[CCode (cname = "GravityNotify")]
+		GRAVITY_NOTIFY,
+		[CCode (cname = "ResizeRequest")]
+		RESIZE_REQUEST,
+		[CCode (cname = "CirculateNotify")]
+		CIRCULATE_NOTIFY,
+		[CCode (cname = "CirculateRequest")]
+		CIRCULATE_REQUEST,
+		[CCode (cname = "PropertyNotify")]
+		PROPERTY_NOTIFY,
+		[CCode (cname = "SelectionClear")]
+		SELECTION_CLEAR,
+		[CCode (cname = "SelectionRequest")]
+		SELECTION_REQUEST,
+		[CCode (cname = "SelectionNotify")]
+		SELECTION_NOTIFY,
+		[CCode (cname = "ColormapNotify")]
+		COLORMAP_NOTIFY,
+		[CCode (cname = "ClientMessage")]
+		CLIENT_MESSAGE,
+		[CCode (cname = "MappingNotify")]
+		MAPPING_NOTIFY
 	}
 
 	// union
@@ -819,75 +969,90 @@ namespace X {
 
 	[CCode (cprefix = "Queued")]
 	public enum QueuedMode {
-		Already,
-		AfterFlush,
-		AfterReading
+		[CCode (cname = "Already")]
+		ALREADY,
+		[CCode (cname = "AfterFlush")]
+		AFTER_FLUSH,
+		[CCode (cname = "AfterReading")]
+		AFTER_READING
 	}
 
 	[CCode (cprefix = "PropMode")]
 	public enum PropMode {
-		Replace,
-		Prepend,
-		Append
+		[CCode (cname = "Replace")]
+		REPLACE,
+		[CCode (cname = "Prepend")]
+		PREPEND,
+		[CCode (cname = "Append")]
+		APPEND
 	}
 
 	[CCode (cprefix = "")]
 	public enum AllowEventsMode {
-		AsyncPointer,
-		SyncPointer,
-		ReplayPointer,
-		AsyncKeyboard,
-		SyncKeyboard,
-		ReplayKeyboard,
-		AsyncBoth,
-		SyncBoth
+		[CCode (cname = "AsyncPointer")]
+		ASYNC_POINTER,
+		[CCode (cname = "SyncPointer")]
+		SYNC_POINTER,
+		[CCode (cname = "ReplayPointer")]
+		REPLAY_POINTER,
+		[CCode (cname = "AsyncKeyboard")]
+		ASYNC_KEYBOARD,
+		[CCode (cname = "SyncKeyboard")]
+		SYNC_KEYBOARD,
+		[CCode (cname = "ReplayKeyboard")]
+		REPLAY_KEYBOARD,
+		[CCode (cname = "AsyncBoth")]
+		ASYNC_BOTH,
+		[CCode (cname = "SyncBoth")]
+		SYNC_BOTH
 	}
 
 	[CCode (cprefix = "")]
 	public enum MapState {
-		IsUnmapped,
-		IsUnviewable,
-		IsViewable
+		[CCode (cname = "IsUnmapped")]
+		IS_UNMAPPED,
+		[CCode (cname = "IsUnviewable")]
+		IS_UNVIEWABLE,
+		[CCode (cname = "IsViewable")]
+		IS_VIEWABLE
 	}
 
 	[CCode (cprefix = "RevertTo")]
 	public enum RevertTo {
-		None,
-		PointerRoot,
-		Parent
+		[CCode (cname = "None")]
+		NONE,
+		[CCode (cname = "PointerRoot")]
+		POINTER_ROOT,
+		[CCode (cname = "Parent")]
+		PARENT
 	}
 
 	[Compact]
 	[CCode (cname = "Screen")]
 	public class Screen {
-		public Display display;
-		public Window root;
-		public int width;
-		public int height;
-
 		[CCode (cname = "XScreenOfDisplay")]
 		public static unowned Screen get_screen (Display disp, int screen_number);
 
 		[CCode (cname = "XBlackPixelOfScreen")]
-		public ulong black_pixel_of_screen ();
+		public ulong get_black_pixel ();
 
 		[CCode (cname = "XCellsOfScreen")]
-		public int cells_of_screen ();
+		public int get_cells ();
 
 		[CCode (cname = "XDefaultColormapOfScreen")]
-		public Colormap default_colormap_of_screen ();
+		public Colormap get_default_colormap ();
 
 		[CCode (cname = "XDefaultDepthOfScreen")]
-		public int default_depth_of_screen ();
+		public int get_default_depth ();
 
 		[CCode (cname = "XDefaultGCOfScreen")]
-		public GC default_gc_of_screen ();
+		public GC get_default_gc ();
 
 		[CCode (cname = "XDefaultVisualOfScreen")]
-		public Visual default_visual_of_screen ();
+		public Visual* get_default_visual ();
 
 		[CCode (cname = "XDisplayOfScreen")]
-		public unowned Display display_of_screen ();
+		public unowned Display get_display ();
 
 		[CCode (cname = "XDoesBackingStore")]
 		public int does_backing_store ();
@@ -896,37 +1061,37 @@ namespace X {
 		public bool does_save_unders ();
 
 		[CCode (cname = "XEventMaskOfScreen")]
-		public long event_mask_of_Screen ();
+		public long get_event_mask ();
 
 		[CCode (cname = "XHeightMMOfScreen")]
-		public int height_in_mm_of_screen ();
+		public int get_height_in_mm ();
 
 		[CCode (cname = "XHeightOfScreen")]
-		public int height_of_screen ();
+		public int get_height ();
 
 		[CCode (cname = "XMaxCmapsOfScreen")]
-		public int max_colormaps_of_screen ();
+		public int get_max_colormaps ();
 
 		[CCode (cname = "XMinCmapsOfScreen")]
-		public int min_colormaps_of_screen ();
+		public int get_min_colormaps ();
 
 		[CCode (cname = "XPlanesOfScreen")]
-		public int planes_of_screen ();
+		public int get_planes ();
 
 		[CCode (cname = "XRootWindowOfScreen")]
-		public Window root_window_of_screen ();
+		public Window get_root_window ();
 
 		[CCode (cname = "XScreenNumberOfScreen")]
-		public int screen_number_of_screen ();
+		public int get_screen_number ();
 
 		[CCode (cname = "XWhitePixelOfScreen")]
-		public ulong white_pixel_of_screen ();
+		public ulong get_white_pixel ();
 
 		[CCode (cname = "XWidthMMOfScreen")]
-		public int width_in_mm_of_screen ();
+		public int get_width_in_mm ();
 
 		[CCode (cname = "XWidthOfScreen")]
-		public int width_of_screen ();
+		public int get_width ();
 	}
 
 	public const X.ID None;
@@ -941,7 +1106,9 @@ namespace X {
 	public const X.Atom XA_WM_NORMAL_HINTS;
 	public const X.Atom XA_WM_TRANSIENT_FOR;
 
-	public const uint XK_Num_Lock;
-	public const uint XK_Scroll_Lock;
+	[CCode (cname = "XK_Num_Lock")]
+	public const uint XK_NUM_LOCK;
+	[CCode (cname = "XK_Scroll_Lock")]
+	public const uint XK_SCROLL_LOCK;
 }
 
