Allow mocking of widgets
Made the getTypeInt match the same logic as the native code