Commits

Alex Szpakowski committed 3e158ba

Added love.window (issue #6.) All window-related functions have been moved from love.graphics to love.window.

love.graphics.setCaption has been renamed to love.window.setTitle.

  • Participants
  • Parent commits 28fd1b1

Comments (0)

Files changed (21)

File platform/macosx/love-framework.xcodeproj/project.pbxproj

 		FA636D8F171B72A70065623F /* wrap_RandomGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FA636D8D171B72A70065623F /* wrap_RandomGenerator.h */; };
 		FA7C937A16DCC6C2006F2BEE /* wrap_Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA7C937516DCC6C2006F2BEE /* wrap_Math.cpp */; };
 		FA7C937B16DCC6C2006F2BEE /* wrap_Math.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7C937616DCC6C2006F2BEE /* wrap_Math.h */; };
+		FA9FC0B0173D6E3E005027FF /* wrap_Window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */; };
+		FA9FC0B1173D6E3E005027FF /* wrap_Window.h in Headers */ = {isa = PBXBuildFile; fileRef = FA9FC0AF173D6E3E005027FF /* wrap_Window.h */; };
 		FAAC6B02170A373B008A61C5 /* CompressedData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAAC6B00170A373A008A61C5 /* CompressedData.cpp */; };
 		FAAC6B03170A373B008A61C5 /* CompressedData.h in Headers */ = {isa = PBXBuildFile; fileRef = FAAC6B01170A373A008A61C5 /* CompressedData.h */; };
 		FAAFF04416CB11C700CCDE45 /* OpenAL-Soft.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAAFF04316CB11C700CCDE45 /* OpenAL-Soft.framework */; };
 		FA636D8D171B72A70065623F /* wrap_RandomGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_RandomGenerator.h; sourceTree = "<group>"; };
 		FA7C937516DCC6C2006F2BEE /* wrap_Math.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Math.cpp; sourceTree = "<group>"; };
 		FA7C937616DCC6C2006F2BEE /* wrap_Math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Math.h; sourceTree = "<group>"; };
+		FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Window.cpp; sourceTree = "<group>"; };
+		FA9FC0AF173D6E3E005027FF /* wrap_Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Window.h; sourceTree = "<group>"; };
 		FAAC6B00170A373A008A61C5 /* CompressedData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompressedData.cpp; sourceTree = "<group>"; };
 		FAAC6B01170A373A008A61C5 /* CompressedData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressedData.h; sourceTree = "<group>"; };
 		FAAFF04316CB11C700CCDE45 /* OpenAL-Soft.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "OpenAL-Soft.framework"; path = "/Library/Frameworks/OpenAL-Soft.framework"; sourceTree = "<absolute>"; };
 		153D76205F7A4ACD12FB4C0E /* window */ = {
 			isa = PBXGroup;
 			children = (
+				63082CBA23A6046C60DA1C6F /* sdl */,
 				351B09E51FDC338622F44624 /* Window.cpp */,
 				7423362764CF57574BB16CDA /* Window.h */,
-				63082CBA23A6046C60DA1C6F /* sdl */,
+				FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */,
+				FA9FC0AF173D6E3E005027FF /* wrap_Window.h */,
 			);
 			path = window;
 			sourceTree = "<group>";
 		6D590DDD41E72A60262E4A4F /* timer */ = {
 			isa = PBXGroup;
 			children = (
+				5CFF12567FFB5C5166631693 /* sdl */,
 				2D9475890CDA3D3776435622 /* Timer.h */,
-				5CFF12567FFB5C5166631693 /* sdl */,
 				695E4ED13AA0689E64280573 /* wrap_Timer.cpp */,
 				7F575BE9573C654B5ED44CC1 /* wrap_Timer.h */,
 			);
 				FAC86E6A1724555D00EED715 /* DrawGable.h in Headers */,
 				FAC86E6C1724555D00EED715 /* Geometry.h in Headers */,
 				FA03546D1731F3A700284828 /* simplexnoise1234.h in Headers */,
+				FA9FC0B1173D6E3E005027FF /* wrap_Window.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 				FAC86E691724555D00EED715 /* DrawGable.cpp in Sources */,
 				FAC86E6B1724555D00EED715 /* Geometry.cpp in Sources */,
 				FA03546C1731F3A700284828 /* simplexnoise1234.cpp in Sources */,
+				FA9FC0B0173D6E3E005027FF /* wrap_Window.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

File src/common/delay.cpp

  **/
 
 #include "delay.h"
-#include <SDL.h>
+
+#include <SDL_timer.h>
 
 namespace love
 {

File src/common/runtime.cpp

 	lua_pushlstring(L, str.data(), str.size());
 }
 
+bool luax_boolflag(lua_State *L, int table_index, const char *key, bool defaultValue)
+{
+	lua_getfield(L, table_index, key);
+
+	bool retval;
+	if (lua_isnoneornil(L, -1))
+		retval = defaultValue;
+	else
+		retval = lua_toboolean(L, -1);
+
+	lua_pop(L, 1);
+	return retval;
+}
+
+int luax_intflag(lua_State *L, int table_index, const char *key, int defaultValue)
+{
+	lua_getfield(L, table_index, key);
+
+	int retval;
+	if (!lua_isnumber(L, -1))
+		retval = defaultValue;
+	else
+		retval = lua_tonumber(L, -1);
+
+	lua_pop(L, 1);
+	return retval;
+}
+
 int luax_assert_argc(lua_State *L, int min)
 {
 	int argc = lua_gettop(L);

File src/common/runtime.h

  **/
 void luax_pushstring(lua_State *L, const std::string &str);
 
+
+bool luax_boolflag(lua_State *L, int table_index, const char *key, bool defaultValue);
+int luax_intflag(lua_State *L, int table_index, const char *key, int defaultValue);
+
+/**
+ * Convert the value at the specified index to an Lua number, and then
+ * convert to a float.
+ *
+ * @param L The Lua state.
+ * @param idx The index on the stack.
+ */
+inline float luax_tofloat(lua_State *L, int idx)
+{
+	return static_cast<float>(lua_tonumber(L, idx));
+}
+
+/**
+ * Like luax_tofloat, but checks that the value is a number.
+ *
+ * @see luax_tofloat
+ */
+inline float luax_checkfloat(lua_State *L, int idx)
+{
+	return static_cast<float>(luaL_checknumber(L, idx));
+}
+
 /**
  * Require at least 'min' number of items on the stack.
  * @param L The Lua state.
  **/
 int luax_getregistry(lua_State *L, Registry r);
 
-Type luax_type(lua_State *L, int idx);
-
-/**
- * Convert the value at the specified index to an Lua number, and then
- * convert to a float.
- *
- * @param L The Lua state.
- * @param idx The index on the stack.
- */
-inline float luax_tofloat(lua_State *L, int idx)
-{
-	return static_cast<float>(lua_tonumber(L, idx));
-}
-
-/**
- * Like luax_tofloat, but checks that the value is a number.
- *
- * @see luax_tofloat
- */
-inline float luax_checkfloat(lua_State *L, int idx)
-{
-	return static_cast<float>(luaL_checknumber(L, idx));
-}
-
-/**
- * Converts the value at idx to the specified type without checking that
- * this conversion is valid. If the type has been previously verified with
- * luax_istype, then this can be safely used. Otherwise, use luax_checktype.
- * @param L The Lua state.
- * @param idx The index on the stack.
- * @param name The name of the type.
- * @param type The type bit.
- **/
-template <typename T>
-T *luax_totype(lua_State *L, int idx, const char *, love::bits)
-{
-	return (T *)(((Proxy *)lua_touserdata(L, idx))->data);
-}
-
 /**
  * Like luax_totype, but causes an error if the value at idx is not Proxy,
  * or is not the specified type.
 	lua_getfield(L, -1, k);
 
 	if (!lua_isuserdata(L, -1))
-		luaL_error(L, "Tried to get nonexisting module %s.", k);
+		luaL_error(L, "Tried to get nonexistant module %s.", k);
 
 	Proxy *u = (Proxy *)lua_touserdata(L, -1);
 
 	return (T *)u->data;
 }
 
+template <typename T>
+T *luax_optmodule(lua_State *L, const char *k, love::bits type)
+{
+	luax_getregistry(L, REGISTRY_MODULES);
+	lua_getfield(L, -1, k);
+
+	if (!lua_isuserdata(L, -1))
+	{
+		lua_pop(L, 2);
+		return 0;
+	}
+
+	Proxy *u = (Proxy *)lua_touserdata(L, -1);
+
+	if ((u->flags & type) != type)
+		luaL_error(L, "Incorrect module %s", k);
+	
+	lua_pop(L, 2);
+	
+	return (T *) u->data;
+}
+
+/**
+ * Converts the value at idx to the specified type without checking that
+ * this conversion is valid. If the type has been previously verified with
+ * luax_istype, then this can be safely used. Otherwise, use luax_checktype.
+ * @param L The Lua state.
+ * @param idx The index on the stack.
+ * @param name The name of the type.
+ * @param type The type bit.
+ **/
+template <typename T>
+T *luax_totype(lua_State *L, int idx, const char *, love::bits)
+{
+	return (T *)(((Proxy *)lua_touserdata(L, idx))->data);
+}
+
+Type luax_type(lua_State *L, int idx);
+
 } // love
 
 #endif // LOVE_RUNTIME_H

File src/common/types.h

 
 	// The modules themselves. Only add abstracted modules here.
 	MODULE_FILESYSTEM_ID,
+	MODULE_GRAPHICS_ID,
 	MODULE_IMAGE_ID,
 	MODULE_SOUND_ID,
 
 
 // Modules.
 const bits MODULE_FILESYSTEM_T = (bits(1) << MODULE_FILESYSTEM_ID) | MODULE_T;
+const bits MODULE_GRAPHICS_T = (bits(1) << MODULE_GRAPHICS_ID) | MODULE_T;
 const bits MODULE_IMAGE_T = (bits(1) << MODULE_IMAGE_ID) | MODULE_T;
 const bits MODULE_SOUND_T = (bits(1) << MODULE_SOUND_ID) | MODULE_T;
 

File src/modules/graphics/Graphics.h

 
 	virtual ~Graphics();
 
+	/**
+	 * Sets the current graphics display viewport and initializes the renderer.
+	 * @param width The viewport width.
+	 * @param height The viewport height.
+	 **/
+	virtual bool setMode(int width, int height) = 0;
+
+	/**
+	 * Un-sets the current graphics display mode (uninitializing objects if
+	 * necessary.)
+	 **/
+	virtual void unSetMode() = 0;
+
 	static bool getConstant(const char *in, DrawMode &out);
 	static bool getConstant(DrawMode in, const char  *&out);
 

File src/modules/graphics/opengl/Graphics.cpp

 	, matrixLimit(0)
 	, userMatrices(0)
 	, colorMask()
+	, width(0)
+	, height(0)
+	, created(false)
+	, savedState()
 {
 	currentWindow = love::window::sdl::Window::getSingleton();
+
+	if (currentWindow->isCreated())
+		setMode(currentWindow->getWidth(), currentWindow->getHeight());
 }
 
 Graphics::~Graphics()
 	return "love.graphics.opengl";
 }
 
-bool Graphics::checkMode(int width, int height, bool fullscreen) const
-{
-	return currentWindow->checkWindowSize(width, height, fullscreen);
-}
-
 DisplayState Graphics::saveState()
 {
 	DisplayState s;
 	setColorMask(s.colorMask[0], s.colorMask[1], s.colorMask[2], s.colorMask[3]);
 }
 
-static void APIENTRY myErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, void *ud)
+bool Graphics::setMode(int width, int height)
 {
-	(void)ud;
-	std::cerr << "source = " << source << ", type = " << type << ", id = " << id << ", severity = " << severity << ", length = " << length << "\n" << message << std::endl;
-}
-
-bool Graphics::setMode(int width, int height, WindowFlags *flags)
-{
-	// This operation destroys the OpenGL context, so
-	// we must save the state.
 	DisplayState tempState;
 	if (isCreated())
-		tempState = saveState();
+		savedState = saveState();
 
-	// Unload all volatile objects. These must be reloaded after
-	// the display mode change.
-	Volatile::unloadAll();
-
-	gl.deInitContext();
-
-	bool success = currentWindow->setWindow(width, height, flags);
-
-	// Regardless of failure, we'll have to set up OpenGL once again.
-	width = currentWindow->getWidth();
-	height = currentWindow->getHeight();
+	this->width = width;
+	this->height = height;
 
 	// Okay, setup OpenGL.
 	gl.initContext();
 		std::cerr << "Could not reload all volatile objects." << std::endl;
 
 	// Restore the display state.
-	restoreState(tempState);
+	restoreState(savedState);
 	pixel_size_stack.clear();
 	pixel_size_stack.reserve(5);
 	pixel_size_stack.push_back(1);
 	glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit);
 	matrixLimit -= 5;
 
-	// Debug output is temporarily disabled until we either improve it and make
-	// it optional or remove it.
-	if (GLEE_KHR_debug && false)
-	{
-		std::cerr << "debug on" << std::endl;
-		glDebugMessageCallback(myErrorCallback, NULL);
-		glEnable(GL_DEBUG_OUTPUT);
-	}
+	created = true;
 
-	return success;
+	return true;
 }
 
-void Graphics::getMode(int &width, int &height, WindowFlags &flags) const
+void Graphics::unSetMode()
 {
-	currentWindow->getWindow(width, height, flags);
-}
+	// Window creation may destroy the OpenGL context, so we must save the state.
+	if (isCreated())
+		savedState = saveState();
 
-bool Graphics::toggleFullscreen()
-{
-	int width, height;
-	WindowFlags flags;
-	currentWindow->getWindow(width, height, flags);
-	flags.fullscreen = !flags.fullscreen;
-	return setMode(width, height, &flags);
+	// Unload all volatile objects. These must be reloaded after
+	// the display mode change.
+	Volatile::unloadAll();
+
+	gl.deInitContext();
 }
 
 void Graphics::reset()
 	currentWindow->swapBuffers();
 }
 
-void Graphics::setIcon(Image *image)
-{
-	if (image->isCompressed())
-		throw love::Exception("Cannot use compressed image data to set an icon.");
-
-	currentWindow->setIcon(image->getData());
-}
-
-void Graphics::setCaption(const char *caption)
-{
-	std::string title(caption);
-	currentWindow->setWindowTitle(title);
-}
-
-std::string Graphics::getCaption() const
-{
-	return currentWindow->getWindowTitle();
-}
-
 int Graphics::getWidth() const
 {
-	return currentWindow->getWidth();
+	return width;
 }
 
 int Graphics::getHeight() const
 {
-	return currentWindow->getHeight();
+	return height;
 }
 
 int Graphics::getRenderWidth() const
 {
 	if (Canvas::current)
 		return Canvas::current->getWidth();
+
 	return getWidth();
 }
 
 {
 	if (Canvas::current)
 		return Canvas::current->getHeight();
+
 	return getHeight();
 }
 
 bool Graphics::isCreated() const
 {
-	return currentWindow->isCreated();
-}
-
-int Graphics::getModes(lua_State *L) const
-{
-	int n;
-	love::window::Window::WindowSize *modes = currentWindow->getFullscreenSizes(n);
-
-	if (modes == 0)
-		return 0;
-
-	lua_createtable(L, n, 0);
-
-	for (int i = 0; i < n ; i++)
-	{
-		lua_pushinteger(L, i+1);
-		lua_createtable(L, 0, 2);
-
-		// Inner table attribs.
-
-		lua_pushinteger(L, modes[i].width);
-		lua_setfield(L, -2, "width");
-
-		lua_pushinteger(L, modes[i].height);
-		lua_setfield(L, -2, "height");
-
-		// Inner table attribs end.
-
-		lua_settable(L, -3);
-	}
-
-	delete[] modes;
-	return 1;
+	return created;
 }
 
 void Graphics::setScissor(int x, int y, int width, int height)
 	pixel_size_stack.push_back(1);
 }
 
-bool Graphics::hasFocus() const
-{
-	return currentWindow->hasFocus();
-}
-
 } // opengl
 } // graphics
 } // love

File src/modules/graphics/opengl/Graphics.h

 	// Implements Module.
 	const char *getName() const;
 
-	/**
-	 * Checks whether a display mode is supported or not. Note
-	 * that fullscreen is assumed, because windowed modes are
-	 * generally supported regardless of size.
-	 * @param width The window width.
-	 * @param height The window height.
-	 **/
-	bool checkMode(int width, int height, bool fullscreen) const;
-
 	DisplayState saveState();
 
 	void restoreState(const DisplayState &s);
 
-	/**
-	 * Sets the current display mode.
-	 * @param width The window width.
-	 * @param height The window height.
-	 * @param flags An optional WindowFlags structure.
-	 **/
-	bool setMode(int width, int height, WindowFlags *flags);
-
-	/**
-	 * Gets the current display mode.
-	 * @param width Pointer to an integer for the window width.
-	 * @param height Pointer to an integer for the window height.
-	 * @param flags A WindowFlags structure.
-	 **/
-	void getMode(int &width, int &height, WindowFlags &flags) const;
-
-	/**
-	 * Toggles fullscreen. Note that this also needs to reload the
-	 * entire OpenGL context.
-	 **/
-	bool toggleFullscreen();
+	virtual bool setMode(int width, int height);
+	virtual void unSetMode();
 
 	/**
 	 * Resets the current color, background color,
 	void clear();
 
 	/**
-	 * Flips buffers. (Rendered geometry is
-	 * presented on screen).
+	 * Flips buffers. (Rendered geometry is presented on screen).
 	 **/
 	void present();
 
 	/**
-	 * Sets the window's icon.
-	 **/
-	void setIcon(Image *image);
-
-	/**
-	 * Sets the window's caption.
-	 **/
-	void setCaption(const char *caption);
-
-	/**
-	 * Gets the window's caption.
-	 **/
-	std::string getCaption() const;
-
-	/**
-	 * Gets the width of the current display mode.
+	 * Gets the width of the current graphics viewport.
 	 **/
 	int getWidth() const;
 
 	/**
-	 * Gets the height of the current display mode.
+	 * Gets the height of the current graphics viewport.
 	 **/
 	int getHeight() const;
 
 	/**
-	 * True if some display mode is set.
+	 * True if a graphics viewport is set.
 	 **/
 	bool isCreated() const;
 
 	/**
-	 * This native Lua function gets available modes
-	 * from SDL and returns them as a table on the following format:
-	 *
-	 * {
-	 *   { width = 800, height = 600 },
-	 *   { width = 1024, height = 768 },
-	 *   ...
-	 * }
-	 *
-	 * Only fullscreen modes are returned here, as all
-	 * window sizes are supported (normally).
-	 **/
-	int getModes(lua_State *L) const;
-
-	/**
 	 * Scissor defines a box such that everything outside that box is discarded and not drawn.
 	 * Scissoring is automatically enabled.
 	 * @param x The x-coordinate of the top-left corner.
 	void shear(float kx, float ky);
 	void origin();
 
-	bool hasFocus() const;
 private:
 
+	int getRenderWidth() const;
+	int getRenderHeight() const;
+
 	Font *currentFont;
 	love::window::Window *currentWindow;
 
 	GLint userMatrices;
 	bool colorMask[4];
 
-	int getRenderWidth() const;
-	int getRenderHeight() const;
+	int width;
+	int height;
+	bool created;
+
+	DisplayState savedState;
 
 }; // Graphics
 

File src/modules/graphics/opengl/wrap_Graphics.cpp

 
 static Graphics *instance = 0;
 
-bool luax_boolflag(lua_State *L, int table_index, const char *key, bool defaultValue)
-{
-	lua_getfield(L, table_index, key);
-
-	bool retval;
-	if (lua_isnoneornil(L, -1))
-		retval = defaultValue;
-	else
-		retval = lua_toboolean(L, -1);
-
-	lua_pop(L, 1);
-	return retval;
-}
-
-int luax_intflag(lua_State *L, int table_index, const char *key, int defaultValue)
-{
-	lua_getfield(L, table_index, key);
-
-	int retval;
-	if (!lua_isnumber(L, -1))
-		retval = defaultValue;
-	else
-		retval = lua_tonumber(L, -1);
-
-	lua_pop(L, 1);
-	return retval;
-}
-
-int w_checkMode(lua_State *L)
-{
-	int w = luaL_checkint(L, 1);
-	int h = luaL_checkint(L, 2);
-	bool fs = luax_toboolean(L, 3);
-	luax_pushboolean(L, instance->checkMode(w, h, fs));
-	return 1;
-}
-
-int w_setMode(lua_State *L)
-{
-	int w = luaL_checkint(L, 1);
-	int h = luaL_checkint(L, 2);
-	if (lua_isnoneornil(L, 3))
-	{
-		luax_pushboolean(L, instance->setMode(w, h, 0));
-		return 1;
-	}
-
-	luaL_checktype(L, 3, LUA_TTABLE);
-
-	WindowFlags flags;
-
-	flags.fullscreen = luax_boolflag(L, 3, "fullscreen", false);
-	flags.vsync = luax_boolflag(L, 3, "vsync", true);
-	flags.fsaa = luax_intflag(L, 3, "fsaa", 0);
-	flags.resizable = luax_boolflag(L, 3, "resizable", false);
-	flags.borderless = luax_boolflag(L, 3, "borderless", false);
-	flags.centered = luax_boolflag(L, 3, "centered", true);
-
-	luax_pushboolean(L, instance->setMode(w, h, &flags));
-	return 1;
-}
-
-int w_getMode(lua_State *L)
-{
-	int w, h;
-	WindowFlags flags;
-	instance->getMode(w, h, flags);
-	lua_pushnumber(L, w);
-	lua_pushnumber(L, h);
-
-	lua_newtable(L);
-
-	luax_pushboolean(L, flags.fullscreen);
-	lua_setfield(L, -2, "fullscreen");
-
-	luax_pushboolean(L, flags.vsync);
-	lua_setfield(L, -2, "vsync");
-
-	lua_pushnumber(L, flags.fsaa);
-	lua_setfield(L, -2, "fsaa");
-
-	luax_pushboolean(L, flags.resizable);
-	lua_setfield(L, -2, "resizable");
-
-	luax_pushboolean(L, flags.borderless);
-	lua_setfield(L, -2, "borderless");
-
-	luax_pushboolean(L, flags.centered);
-	lua_setfield(L, -2, "centered");
-
-	return 3;
-}
-
-int w_toggleFullscreen(lua_State *L)
-{
-	luax_pushboolean(L, instance->toggleFullscreen());
-	return 1;
-}
-
 int w_reset(lua_State *)
 {
 	instance->reset();
 	return 0;
 }
 
-int w_setIcon(lua_State *L)
-{
-	Image *image = luax_checkimage(L, 1);
-	try
-	{
-		instance->setIcon(image);
-	}
-	catch (love::Exception &e)
-	{
-		return luaL_error(L, "%s", e.what());
-	}
-	return 0;
-}
-
-int w_setCaption(lua_State *L)
-{
-	const char *str = luaL_checkstring(L, 1);
-	instance->setCaption(str);
-	return 0;
-}
-
-int w_getCaption(lua_State *L)
-{
-	std::string caption = instance->getCaption();
-	lua_pushstring(L, caption.c_str());
-	return 1;
-}
-
-int w_getWidth(lua_State *L)
-{
-	lua_pushnumber(L, instance->getWidth());
-	return 1;
-}
-
-int w_getHeight(lua_State *L)
-{
-	lua_pushnumber(L, instance->getHeight());
-	return 1;
-}
-
-int w_getDimensions(lua_State *L)
-{
-	lua_pushnumber(L, instance->getWidth());
-	lua_pushnumber(L, instance->getHeight());
-	return 2;
-}
-
 int w_isCreated(lua_State *L)
 {
 	luax_pushboolean(L, instance->isCreated());
 	return 1;
 }
 
-int w_getModes(lua_State *L)
-{
-	return instance->getModes(L);
-}
-
 int w_setScissor(lua_State *L)
 {
 	if (lua_gettop(L) == 0)
 	return 0;
 }
 
-int w_hasFocus(lua_State *L)
-{
-	luax_pushboolean(L, instance->hasFocus());
-	return 1;
-}
-
 
 // List of functions to wrap.
 static const luaL_Reg functions[] =
 {
-	{ "checkMode", w_checkMode },
-	{ "setMode", w_setMode },
-	{ "getMode", w_getMode },
-	{ "toggleFullscreen", w_toggleFullscreen },
 	{ "reset", w_reset },
 	{ "clear", w_clear },
 	{ "present", w_present },
 	{ "print", w_print },
 	{ "printf", w_printf },
 
-	{ "setCaption", w_setCaption },
-	{ "getCaption", w_getCaption },
-
-	{ "setIcon", w_setIcon },
-
-	{ "getWidth", w_getWidth },
-	{ "getHeight", w_getHeight },
-	{ "getDimensions", w_getDimensions },
-
 	{ "isCreated", w_isCreated },
 
-	{ "getModes", w_getModes },
-
 	{ "setScissor", w_setScissor },
 	{ "getScissor", w_getScissor },
 
 	{ "shear", w_shear },
 	{ "origin", w_origin },
 
-	{ "hasFocus", w_hasFocus },
-
 	{ 0, 0 }
 };
 
 	WrappedModule w;
 	w.module = instance;
 	w.name = "graphics";
-	w.flags = MODULE_T;
+	w.flags = MODULE_GRAPHICS_T;
 	w.functions = functions;
 	w.types = types;
 

File src/modules/graphics/opengl/wrap_Graphics.h

 namespace opengl
 {
 
-int w_checkMode(lua_State *L);
-int w_setMode(lua_State *L);
-int w_getMode(lua_State *L);
-int w_toggleFullscreen(lua_State *L);
 int w_reset(lua_State *L);
 int w_clear(lua_State *L);
 int w_present(lua_State *L);
-int w_setIcon(lua_State *L);
-int w_setCaption(lua_State *L);
-int w_getCaption(lua_State *L);
-int w_getWidth(lua_State *L);
-int w_getHeight(lua_State *L);
-int w_getDimensions(lua_State *L);
 int w_isCreated(lua_State *L);
 int w_setScissor(lua_State *L);
 int w_getScissor(lua_State *L);
 int w_translate(lua_State *L);
 int w_shear(lua_State *L);
 int w_origin(lua_State *L);
-int w_hasFocus(lua_State *L);
 extern "C" LOVE_EXPORT int luaopen_love_graphics(lua_State *L);
 
 } // opengl

File src/modules/love/love.cpp

 	extern int luaopen_love_image(lua_State*);
 	extern int luaopen_love_joystick(lua_State*);
 	extern int luaopen_love_keyboard(lua_State*);
+	extern int luaopen_love_math(lua_State*);
 	extern int luaopen_love_mouse(lua_State*);
 	extern int luaopen_love_physics(lua_State*);
 	extern int luaopen_love_sound(lua_State*);
 	extern int luaopen_love_timer(lua_State*);
 	extern int luaopen_love_thread(lua_State*);
-	extern int luaopen_love_math(lua_State*);
+	extern int luaopen_love_window(lua_State*);
 	extern int luaopen_love_boot(lua_State*);
 }
 
 	{ "love.sound", luaopen_love_sound },
 	{ "love.timer", luaopen_love_timer },
 	{ "love.thread", luaopen_love_thread },
+	{ "love.window", luaopen_love_window },
 	{ "love.boot", luaopen_love_boot },
 	{ 0, 0 }
 };

File src/modules/timer/sdl/Timer.cpp

 	, fpsUpdateFrequency(1)
 	, frames(0)
 	, dt(0)
-	, timerFrequency(getTimerFrequency())
+	, timerPeriod(getTimerPeriod())
 {
 	// Init the SDL timer system (needed for SDL_Delay.)
 	if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0)
 	// "Current" time is previous time by now.
 	prevTime = currTime;
 
-	// Get ticks from system.
+	// Get time from system.
 	currTime = getTime();
 
 	// Convert to number of seconds.
 	return averageDelta;
 }
 
-double Timer::getTimerFrequency()
+double Timer::getTimerPeriod()
 {
 #if defined(LOVE_MACOSX)
 	mach_timebase_info_data_t info;
 		mt = getTimeOfDay();
 	return mt;
 #elif defined(LOVE_MACOSX)
-	return (double) mach_absolute_time() * timerFrequency;
+	return (double) mach_absolute_time() * timerPeriod;
 #elif defined(LOVE_WINDOWS)
 	LARGE_INTEGER microTime;
 	QueryPerformanceCounter(&microTime);
-	return (double) microTime.QuadPart * timerFrequency;
+	return (double) microTime.QuadPart * timerPeriod;
 #endif
 }
 

File src/modules/timer/sdl/Timer.h

 	// The current timestep.
 	double dt;
 
-	// The reciprocal of the timer frequency.
-	const double timerFrequency;
+	// The timer period (reciprocal of the frequency.)
+	const double timerPeriod;
 
-	// Returns the timer frequency on some platforms.
-	static double getTimerFrequency();
+	// Returns the timer period on some platforms.
+	static double getTimerPeriod();
 	
 }; // Timer
 

File src/modules/timer/wrap_Timer.cpp

 
 int w_getFPS(lua_State *L)
 {
-	lua_pushnumber(L, instance->getFPS());
+	lua_pushinteger(L, instance->getFPS());
 	return 1;
 }
 
 
 int w_sleep(lua_State *L)
 {
-	instance->sleep((float) luaL_checknumber(L, 1));
+	instance->sleep(luaL_checknumber(L, 1));
 	return 0;
 }
 
 			instance = new love::timer::sdl::Timer();
 
 		}
-		catch(Exception &e)
+		catch (Exception &e)
 		{
-			return luaL_error(L, e.what());
+			return luaL_error(L, "%s", e.what());
 		}
 	}
 	else

File src/modules/window/Window.h

 
 // LOVE
 #include "common/Module.h"
-#include <image/ImageData.h>
+#include "image/ImageData.h"
+#include "graphics/Graphics.h"
 
 namespace love
 {
 
 	virtual ~Window();
 
-	virtual bool setWindow(int width = 800, int height = 600, WindowFlags *flags = 0) = 0;
+	virtual bool setWindow(int width = 800, int height = 600, graphics::Graphics *graphics = 0, WindowFlags *flags = 0) = 0;
 	virtual void getWindow(int &width, int &height, WindowFlags &flags) const = 0;
 
 	virtual bool checkWindowSize(int width, int height, bool fullscreen) const = 0;

File src/modules/window/sdl/Window.cpp

 {
 }
 
-bool Window::setWindow(int width, int height, WindowFlags *flags)
+bool Window::setWindow(int width, int height, graphics::Graphics *graphics, WindowFlags *flags)
 {
+
+	if (graphics)
+		graphics->unSetMode();
+
 	bool fullscreen = false;
 	bool vsync = true;
 	int fsaa = 0;
 	currentMode.flags.borderless = ((surface->flags & SDL_NOFRAME) != 0);
 	currentMode.flags.centered = centered;
 
+	if (graphics)
+		graphics->setMode(width, height);
+
 	return true;
 }
 

File src/modules/window/sdl/Window.h

 	Window();
 	~Window();
 
-	bool setWindow(int width = 800, int height = 600, WindowFlags *flags = 0);
+	bool setWindow(int width = 800, int height = 600, graphics::Graphics *graphics = 0, WindowFlags *flags = 0);
 	void getWindow(int &width, int &height, WindowFlags &flags) const;
 
 	bool checkWindowSize(int width, int height, bool fullscreen) const;

File src/modules/window/wrap_Window.cpp

+/**
+ * Copyright (c) 2006-2013 LOVE Development Team
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty.  In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ **/
+
+#include "wrap_Window.h"
+#include "sdl/Window.h"
+
+namespace love
+{
+namespace window
+{
+
+static Window *instance = 0;
+
+int w_checkMode(lua_State *L)
+{
+	int w = luaL_checkint(L, 1);
+	int h = luaL_checkint(L, 2);
+	bool fs = luax_toboolean(L, 3);
+	luax_pushboolean(L, instance->checkWindowSize(w, h, fs));
+	return 1;
+}
+
+int w_setMode(lua_State *L)
+{
+	int w = luaL_checkint(L, 1);
+	int h = luaL_checkint(L, 2);
+
+	graphics::Graphics *g = luax_optmodule<graphics::Graphics>(L, "graphics", MODULE_GRAPHICS_T);
+
+	if (lua_isnoneornil(L, 3))
+	{
+		luax_pushboolean(L, instance->setWindow(w, h, g, 0));
+		return 1;
+	}
+
+	luaL_checktype(L, 3, LUA_TTABLE);
+
+	WindowFlags flags;
+
+	flags.fullscreen = luax_boolflag(L, 3, "fullscreen", false);
+	flags.vsync = luax_boolflag(L, 3, "vsync", true);
+	flags.fsaa = luax_intflag(L, 3, "fsaa", 0);
+	flags.resizable = luax_boolflag(L, 3, "resizable", false);
+	flags.borderless = luax_boolflag(L, 3, "borderless", false);
+	flags.centered = luax_boolflag(L, 3, "centered", true);
+
+	try
+	{
+		luax_pushboolean(L, instance->setWindow(w, h, g, &flags));
+	}
+	catch (love::Exception &e)
+	{
+		return luaL_error(L, "%s", e.what());
+	}
+
+	return 1;
+}
+
+int w_getMode(lua_State *L)
+{
+	int w, h;
+	WindowFlags flags;
+	instance->getWindow(w, h, flags);
+	lua_pushnumber(L, w);
+	lua_pushnumber(L, h);
+
+	lua_newtable(L);
+
+	luax_pushboolean(L, flags.fullscreen);
+	lua_setfield(L, -2, "fullscreen");
+
+	luax_pushboolean(L, flags.vsync);
+	lua_setfield(L, -2, "vsync");
+
+	lua_pushnumber(L, flags.fsaa);
+	lua_setfield(L, -2, "fsaa");
+
+	luax_pushboolean(L, flags.resizable);
+	lua_setfield(L, -2, "resizable");
+
+	luax_pushboolean(L, flags.borderless);
+	lua_setfield(L, -2, "borderless");
+
+	luax_pushboolean(L, flags.centered);
+	lua_setfield(L, -2, "centered");
+	
+	return 3;
+}
+
+int w_getModes(lua_State *L)
+{
+	int n;
+	Window::WindowSize *modes = instance->getFullscreenSizes(n);
+
+	if (modes == 0)
+		return 0;
+
+	lua_createtable(L, n, 0);
+
+	for (int i = 0; i < n ; i++)
+	{
+		lua_pushinteger(L, i+1);
+		lua_createtable(L, 0, 2);
+
+		// Inner table attribs.
+
+		lua_pushinteger(L, modes[i].width);
+		lua_setfield(L, -2, "width");
+
+		lua_pushinteger(L, modes[i].height);
+		lua_setfield(L, -2, "height");
+
+		// Inner table attribs end.
+
+		lua_settable(L, -3);
+	}
+
+	delete[] modes;
+	return 1;
+}
+
+int w_toggleFullscreen(lua_State *L)
+{
+	graphics::Graphics *g = luax_optmodule<graphics::Graphics>(L, "graphics", MODULE_GRAPHICS_T);
+
+	int width, height;
+	WindowFlags flags;
+	instance->getWindow(width, height, flags);
+	flags.fullscreen = !flags.fullscreen;
+
+	try
+	{
+		luax_pushboolean(L, instance->setWindow(width, height, g, &flags));
+	}
+	catch (love::Exception &e)
+	{
+		return luaL_error(L, "%s", e.what());
+	}
+
+	return 1;
+}
+
+int w_isCreated(lua_State *L)
+{
+	luax_pushboolean(L, instance->isCreated());
+	return 1;
+}
+
+int w_getWidth(lua_State *L)
+{
+	lua_pushinteger(L, instance->getWidth());
+	return 1;
+}
+
+int w_getHeight(lua_State *L)
+{
+	lua_pushinteger(L, instance->getHeight());
+	return 1;
+}
+
+int w_getDimensions(lua_State *L)
+{
+	lua_pushinteger(L, instance->getWidth());
+	lua_pushinteger(L, instance->getHeight());
+	return 2;
+}
+
+int w_setIcon(lua_State *L)
+{
+	image::ImageData *i = luax_checktype<image::ImageData>(L, 1, "ImageData", IMAGE_IMAGE_DATA_T);
+	instance->setIcon(i);
+	return 0;
+}
+
+int w_setTitle(lua_State *L)
+{
+	std::string title = luax_checkstring(L, 1);
+	instance->setWindowTitle(title);
+	return 0;
+}
+
+int w_getTitle(lua_State *L)
+{
+	luax_pushstring(L, instance->getWindowTitle());
+	return 1;
+}
+
+int w_hasFocus(lua_State *L)
+{
+	luax_pushboolean(L, instance->hasFocus());
+	return 1;
+}
+
+static const luaL_Reg functions[] =
+{
+	{ "checkMode", w_checkMode },
+	{ "setMode", w_setMode },
+	{ "getMode", w_getMode },
+	{ "getModes", w_getModes },
+	{ "toggleFullscreen", w_toggleFullscreen },
+	{ "isCreated", w_isCreated },
+	{ "getWidth", w_getWidth },
+	{ "getHeight", w_getHeight },
+	{ "getDimensions", w_getDimensions },
+	{ "setIcon", w_setIcon },
+	{ "setTitle", w_setTitle },
+	{ "getTitle", w_getTitle },
+	{ "hasFocus", w_hasFocus },
+	{ 0, 0 }
+};
+
+extern "C" int luaopen_love_window(lua_State *L)
+{
+	try
+	{
+		instance = sdl::Window::getSingleton();
+	}
+	catch (love::Exception &e)
+	{
+		return luaL_error(L, "%s", e.what());
+	}
+
+	WrappedModule w;
+	w.module = instance;
+	w.name = "window";
+	w.flags = MODULE_T;
+	w.functions = functions;
+	w.types = 0;
+
+	return luax_register_module(L, w);
+}
+
+} // window
+} // love

File src/modules/window/wrap_Window.h

+/**
+ * Copyright (c) 2006-2013 LOVE Development Team
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty.  In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ **/
+
+#ifndef LOVE_WINDOW_WRAP_WINDOW_H
+#define LOVE_WINDOW_WRAP_WINDOW_H
+
+#include "common/config.h"
+#include "common/runtime.h"
+
+namespace love
+{
+namespace window
+{
+
+int w_checkMode(lua_State *L);
+int w_setMode(lua_State *L);
+int w_getMode(lua_State *L);
+int w_getModes(lua_State *L);
+int w_toggleFullscreen(lua_State *L);
+int w_isCreated(lua_State *L);
+int w_getWidth(lua_State *L);
+int w_getHeight(lua_State *L);
+int w_getDimensions(lua_State *L);
+int w_setIcon(lua_State *L);
+int w_setTitle(lua_State *L);
+int w_getTitle(lua_State *L);
+int w_hasFocus(lua_State *L);
+extern "C" LOVE_EXPORT int luaopen_love_window(lua_State *L);
+
+} // window
+} // love
+
+#endif // LOVE_WINDOW_WRAP_WINDOW_H

File src/scripts/boot.lua

 			return
 		end,
 		resize = function(w, h)
-			local ow, oh, flags = love.graphics.getMode()
+			local ow, oh, flags = love.window.getMode()
 			if flags.resizable then
-				love.graphics.setMode(w, h, flags)
+				love.window.setMode(w, h, flags)
 				if love.resize then return love.resize(w, h) end
 			end
 		end,
 			sound = true,
 			font = true,
 			thread = true,
+			window = true,
 		},
 		console = false, -- Only relevant for windows.
 		identity = false,
 		"image",
 		"font",
 		"graphics",
+		"window",
 		"math",
 		"physics",
 	} do
 
 	-- Setup screen here.
 	local has_window = false
-	if c.screen and c.modules.graphics then
-		if love.graphics.checkMode(c.screen.width, c.screen.height, c.screen.fullscreen) or (c.screen.width == 0 and c.screen.height == 0) then
-			assert(love.graphics.setMode(c.screen.width, c.screen.height,
+	if c.screen and c.modules.window then
+		if love.window.checkMode(c.screen.width, c.screen.height, c.screen.fullscreen) or (c.screen.width == 0 and c.screen.height == 0) then
+			assert(love.window.setMode(c.screen.width, c.screen.height,
 			{
 				fullscreen = c.screen.fullscreen,
 				vsync = c.screen.vsync,
 		else
 			error("Could not set screen mode")
 		end
-		love.graphics.setCaption(c.title)
+		love.window.setTitle(c.title)
 	end
 
 	-- Console hack
 
 		-- Call update and draw
 		if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled
-		if love.graphics then
+		if love.window and love.graphics then
 			love.graphics.clear()
 			love.graphics.origin()
 			if love.draw then love.draw() end
 		end
 
-		if love.graphics then love.graphics.present() end
+		if love.window and love.graphics then
+			love.graphics.present()
+		end
 		if love.timer then love.timer.sleep(0.001) end
 
 	end
 
 	local hearts = {}
 	local rings = {}
-	
+
 	local cx = 400
 	local cy = 300
-	
+
 	local pig
 	local heart_image
-	
+
 	local function add_heart_ring(radius, number, speed)
 		local step = math.pi*2/number
 		for i = 1,number do
 		end
 		table.insert(rings, radius)
 	end
-	
+
 	local function update_hearts(dt)
 		for i,v in ipairs(hearts) do
 			v.position = v.position + v.speed*dt*0.6
 		end
 	end
-	
+
 	local function draw_hearts()
 		for i,v in ipairs(hearts) do
 			local x = math.cos(v.position) * v.radius + cx
 			love.graphics.draw(heart_image, x, y, v.position+0.4, 1, 1, 32, 32)
 		end
 	end
-	
+
 	local function draw_pig(p)
 		love.graphics.setColor(255, 255, 255, 255)
 		love.graphics.draw(p.img, p.x, p.y, 0, 1, 1, 128, 128)
 
 	error_printer(msg, 2)
 
-	if not love.graphics or not love.event or not love.graphics.isCreated() then
+	if not love.window or not love.graphics or not love.event or not love.window.isCreated() then
 		return
 	end
 
 
 	local function draw()
 		love.graphics.clear()
-		love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70)
+		love.graphics.printf(p, 70, 70, love.window.getWidth() - 70)
 		love.graphics.present()
 	end
 
 
 	local function draw()
 		love.graphics.clear()
-		love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70)
+		love.graphics.printf(p, 70, 70, love.window.getWidth() - 70)
 		love.graphics.present()
 	end
 

File src/scripts/boot.lua.h

 	0x09, 0x09, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 
 	0x6e, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x29, 0x0a,
 	0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6f, 0x77, 0x2c, 0x20, 0x6f, 0x68, 0x2c, 0x20, 0x66, 
-	0x6c, 0x61, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 
-	0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x0a,
+	0x6c, 0x61, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 
+	0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x0a,
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x61, 
 	0x62, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 
-	0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x2c, 0x20, 0x66, 0x6c, 0x61, 0x67, 
-	0x73, 0x29, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, 
+	0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x2c, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x29, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 
 	0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 
 	0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a,
+	0x09, 0x09, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a,
 	0x09, 0x09, 0x7d, 0x2c, 0x0a,
 	0x09, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 
 	0x20, 0x2d, 0x2d, 0x20, 0x4f, 0x6e, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20, 
 	0x09, 0x09, 0x22, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x2c, 0x0a,
 	0x09, 0x09, 0x22, 0x66, 0x6f, 0x6e, 0x74, 0x22, 0x2c, 0x0a,
 	0x09, 0x09, 0x22, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x22, 0x2c, 0x0a,
+	0x09, 0x09, 0x22, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x2c, 0x0a,
 	0x09, 0x09, 0x22, 0x6d, 0x61, 0x74, 0x68, 0x22, 0x2c, 0x0a,
 	0x09, 0x09, 0x22, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x73, 0x22, 0x2c, 0x0a,
 	0x09, 0x7d, 0x20, 0x64, 0x6f, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 
 	0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0a,
 	0x09, 0x69, 0x66, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 
-	0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 
-	0x74, 0x68, 0x65, 0x6e, 0x0a,
-	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 
-	0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 
-	0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 
-	0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x66, 
-	0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x28, 0x63, 0x2e, 0x73, 
-	0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x20, 0x61, 
-	0x6e, 0x64, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 
-	0x20, 0x3d, 0x3d, 0x20, 0x30, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
-	0x09, 0x09, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 
-	0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, 
-	0x72, 0x65, 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 
-	0x65, 0x6e, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x0a,
+	0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x74, 0x68, 
+	0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x63, 
+	0x68, 0x65, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 
+	0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x68, 0x65, 
+	0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x66, 0x75, 0x6c, 
+	0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, 
+	0x65, 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x20, 0x61, 0x6e, 0x64, 
+	0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, 
+	0x3d, 0x20, 0x30, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 
+	0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 
+	0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 
+	0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x7b, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x63, 
 	0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 
 	0x74, 0x20, 0x73, 0x65, 0x74, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x22, 
 	0x29, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
-	0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 
-	0x74, 0x43, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x2e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x29, 0x0a,
+	0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, 0x74, 0x54, 
+	0x69, 0x74, 0x6c, 0x65, 0x28, 0x63, 0x2e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x29, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x2d, 0x2d, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x68, 0x61, 0x63, 0x6b, 0x0a,
 	0x09, 0x69, 0x66, 0x20, 0x63, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 
 	0x29, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x2d, 0x2d, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x61, 0x73, 0x73, 
 	0x20, 0x30, 0x20, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x20, 0x69, 
 	0x73, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x0a,
-	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 
-	0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x61, 
+	0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x74, 
+	0x68, 0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x63, 
 	0x6c, 0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
 	0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6f, 
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x20, 0x74, 0x68, 
 	0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x28, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
-	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 
-	0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 
-	0x73, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
+	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x61, 
+	0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x74, 
+	0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 
+	0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
+	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x20, 0x74, 0x68, 
 	0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x73, 0x6c, 0x65, 0x65, 
 	0x70, 0x28, 0x30, 0x2e, 0x30, 0x30, 0x31, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
 	0x4a, 0x67, 0x67, 0x67, 0x3d, 0x3d, 0x22, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x65, 0x61, 0x72, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a,
-	0x09, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x63, 0x78, 0x20, 0x3d, 0x20, 0x34, 0x30, 0x30, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x63, 0x79, 0x20, 0x3d, 0x20, 0x33, 0x30, 0x30, 0x0a,
-	0x09, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x70, 0x69, 0x67, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x0a,
-	0x09, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x64, 
 	0x64, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x72, 0x61, 0x64, 0x69, 0x75, 
 	0x73, 0x2c, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x29, 0x0a,
 	0x09, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x28, 0x72, 0x69, 0x6e, 
 	0x67, 0x73, 0x2c, 0x20, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x29, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
-	0x09, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x70, 
 	0x64, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x73, 0x28, 0x64, 0x74, 0x29, 0x0a,
 	0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x2c, 0x76, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x70, 0x61, 0x69, 0x72, 
 	0x2a, 0x64, 0x74, 0x2a, 0x30, 0x2e, 0x36, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
-	0x09, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x72, 
 	0x61, 0x77, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x73, 0x28, 0x29, 0x0a,
 	0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x2c, 0x76, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x70, 0x61, 0x69, 0x72, 
 	0x34, 0x2c, 0x20, 0x31, 0x2c, 0x20, 0x31, 0x2c, 0x20, 0x33, 0x32, 0x2c, 0x20, 0x33, 0x32, 0x29, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
-	0x09, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x72, 
 	0x61, 0x77, 0x5f, 0x70, 0x69, 0x67, 0x28, 0x70, 0x29, 0x0a,
 	0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 
 	0x67, 0x29, 0x0a,
 	0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x6d, 0x73, 0x67, 
 	0x2c, 0x20, 0x32, 0x29, 0x0a,
-	0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 
-	0x69, 0x63, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x76, 
-	0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 
-	0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x28, 0x29, 
-	0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 
+	0x77, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 
+	0x68, 0x69, 0x63, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 
+	0x76, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 
+	0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x28, 0x29, 0x20, 
+	0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x2d, 0x2d, 0x20, 0x4c, 0x6f, 0x61, 0x64, 0x2e, 0x0a,
 	0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
 	0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 
 	0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x6c, 0x6f, 
-	0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 
-	0x74, 0x68, 0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
+	0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 
+	0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
 	0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 
 	0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
 	0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 
 	0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x6c, 0x6f, 
-	0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 
-	0x74, 0x68, 0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
+	0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 
+	0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
 	0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 
 	0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,