//#include "script_system.hpp"

#include "pw/system/window.hpp"
#include "pw/system/input.hpp"
#include "pw/system/display.hpp"
#include "pw/system/path.hpp"

#include "runtime_lua.hpp"

#include "pw/core/debug.hpp"

namespace pw {

void register_system_function(sol::state&, sol::table &ns)
{
    ns.new_usertype<window>("window",
                            "update",&window::update,
                            "on_update",sol::writeonly_property(&window::set_on_update),
                            "title",sol::writeonly_property(&window::set_title),
                            "size",sol::property(&window::size,&window::set_size),
                            "client_size",sol::readonly_property(&window::client_size),
                            "position",sol::property(&window::position,&window::set_position),
                            "fullscreen",sol::property(&window::fullscreen,&window::set_fullscreen),
                            "visible",sol::property(&window::visible,&window::set_visible)
                            );


    ns.new_usertype<input>("input",
                           "new", sol::no_constructor,
                           "get",&input::get,
                           "mouse_position",sol::readonly_property(&input::mouse_position),
                           "mouse_button",sol::readonly_property(&input::mouse_button),
                           "mouse_pressed",sol::readonly_property(&input::mouse_pressed),
                           "input_string",sol::readonly_property(&input::input_string)
                           );

    ns.new_usertype<display>("display",
                             "all",&display::all,
                             "name",sol::readonly_property(&display::name)
                             );

	ns.new_usertype<path>("path"
						  ,"new", sol::no_constructor
						  ,"get",&path::get
						  ,"separator",sol::readonly_property(&path::separator)
						  ,"executable_path",sol::readonly_property(&path::executable_path)
						  );
}




PW_REGISTER_LUA(system)


}
