#include <hxcpp.h>

#ifndef INCLUDED_Luxe
#include <Luxe.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_luxe_Core
#include <luxe/Core.h>
#endif
#ifndef INCLUDED_luxe_Cursor
#include <luxe/Cursor.h>
#endif
#ifndef INCLUDED_luxe_Screen
#include <luxe/Screen.h>
#endif
#ifndef INCLUDED_phoenix_Vector
#include <phoenix/Vector.h>
#endif
#ifndef INCLUDED_snow_App
#include <snow/App.h>
#endif
#ifndef INCLUDED_snow_Snow
#include <snow/Snow.h>
#endif
#ifndef INCLUDED_snow_window_Window
#include <snow/window/Window.h>
#endif
#ifndef INCLUDED_snow_window_Windowing
#include <snow/window/Windowing.h>
#endif
namespace luxe{

Void Cursor_obj::__construct(::luxe::Screen _screen)
{
HX_STACK_FRAME("luxe.Cursor","new",0xa48b30a0,"luxe.Cursor.new","luxe/Screen.hx",66,0xd2f30fd9)

HX_STACK_ARG(_screen,"_screen")
{
	HX_STACK_LINE(73)
	this->lock = false;
	HX_STACK_LINE(72)
	this->grab = false;
	HX_STACK_LINE(71)
	this->visible = true;
	HX_STACK_LINE(79)
	this->screen = _screen;
	HX_STACK_LINE(80)
	this->set_pos(::phoenix::Vector_obj::__new(null(),null(),null(),null()));
}
;
	return null();
}

//Cursor_obj::~Cursor_obj() { }

Dynamic Cursor_obj::__CreateEmpty() { return  new Cursor_obj; }
hx::ObjectPtr< Cursor_obj > Cursor_obj::__new(::luxe::Screen _screen)
{  hx::ObjectPtr< Cursor_obj > result = new Cursor_obj();
	result->__construct(_screen);
	return result;}

Dynamic Cursor_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< Cursor_obj > result = new Cursor_obj();
	result->__construct(inArgs[0]);
	return result;}

bool Cursor_obj::get_visible( ){
	HX_STACK_FRAME("luxe.Cursor","get_visible",0xa01078c9,"luxe.Cursor.get_visible","luxe/Screen.hx",87,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_LINE(87)
	return this->visible;
}


HX_DEFINE_DYNAMIC_FUNC0(Cursor_obj,get_visible,return )

bool Cursor_obj::set_visible( bool _visible){
	HX_STACK_FRAME("luxe.Cursor","set_visible",0xaa7d7fd5,"luxe.Cursor.set_visible","luxe/Screen.hx",91,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_visible,"_visible")
	HX_STACK_LINE(93)
	this->screen->core->app->windowing->enable_cursor(_visible);
	HX_STACK_LINE(95)
	return this->visible = _visible;
}


HX_DEFINE_DYNAMIC_FUNC1(Cursor_obj,set_visible,return )

bool Cursor_obj::get_grab( ){
	HX_STACK_FRAME("luxe.Cursor","get_grab",0x520a4315,"luxe.Cursor.get_grab","luxe/Screen.hx",101,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_LINE(101)
	return this->grab;
}


HX_DEFINE_DYNAMIC_FUNC0(Cursor_obj,get_grab,return )

bool Cursor_obj::get_lock( ){
	HX_STACK_FRAME("luxe.Cursor","get_lock",0x55560f34,"luxe.Cursor.get_lock","luxe/Screen.hx",107,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_LINE(107)
	return this->lock;
}


HX_DEFINE_DYNAMIC_FUNC0(Cursor_obj,get_lock,return )

bool Cursor_obj::set_grab( bool _grab){
	HX_STACK_FRAME("luxe.Cursor","set_grab",0x00679c89,"luxe.Cursor.set_grab","luxe/Screen.hx",111,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_grab,"_grab")
	HX_STACK_LINE(113)
	this->screen->core->app->window->set_grab(_grab);
	HX_STACK_LINE(115)
	return this->grab = _grab;
}


HX_DEFINE_DYNAMIC_FUNC1(Cursor_obj,set_grab,return )

bool Cursor_obj::set_lock( bool _lock){
	HX_STACK_FRAME("luxe.Cursor","set_lock",0x03b368a8,"luxe.Cursor.set_lock","luxe/Screen.hx",119,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_lock,"_lock")
	HX_STACK_LINE(121)
	this->screen->core->app->windowing->enable_cursor_lock(_lock);
	HX_STACK_LINE(123)
	return this->lock = _lock;
}


HX_DEFINE_DYNAMIC_FUNC1(Cursor_obj,set_lock,return )

::phoenix::Vector Cursor_obj::get_pos( ){
	HX_STACK_FRAME("luxe.Cursor","get_pos",0x03d6a66b,"luxe.Cursor.get_pos","luxe/Screen.hx",127,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_LINE(129)
	if (((this->pos != null()))){
		HX_STACK_LINE(130)
		this->pos->set_xy(::Luxe_obj::mouse->x,::Luxe_obj::mouse->y);
	}
	HX_STACK_LINE(133)
	return this->pos;
}


HX_DEFINE_DYNAMIC_FUNC0(Cursor_obj,get_pos,return )

::phoenix::Vector Cursor_obj::set_pos( ::phoenix::Vector _p){
	HX_STACK_FRAME("luxe.Cursor","set_pos",0xf6d83777,"luxe.Cursor.set_pos","luxe/Screen.hx",137,0xd2f30fd9)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_p,"_p")
	HX_STACK_LINE(139)
	if (((this->get_pos() != null()))){
		HX_STACK_LINE(141)
		int _g = ::Std_obj::_int(_p->x);		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(141)
		this->screen->core->app->window->set_cursor_position(_g,::Std_obj::_int(_p->y));
	}
	HX_STACK_LINE(145)
	return this->pos = _p;
}


HX_DEFINE_DYNAMIC_FUNC1(Cursor_obj,set_pos,return )


Cursor_obj::Cursor_obj()
{
}

void Cursor_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Cursor);
	HX_MARK_MEMBER_NAME(screen,"screen");
	HX_MARK_MEMBER_NAME(visible,"visible");
	HX_MARK_MEMBER_NAME(grab,"grab");
	HX_MARK_MEMBER_NAME(lock,"lock");
	HX_MARK_MEMBER_NAME(pos,"pos");
	HX_MARK_END_CLASS();
}

void Cursor_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(screen,"screen");
	HX_VISIT_MEMBER_NAME(visible,"visible");
	HX_VISIT_MEMBER_NAME(grab,"grab");
	HX_VISIT_MEMBER_NAME(lock,"lock");
	HX_VISIT_MEMBER_NAME(pos,"pos");
}

Dynamic Cursor_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"pos") ) { return inCallProp ? get_pos() : pos; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"grab") ) { return inCallProp ? get_grab() : grab; }
		if (HX_FIELD_EQ(inName,"lock") ) { return inCallProp ? get_lock() : lock; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"screen") ) { return screen; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"visible") ) { return inCallProp ? get_visible() : visible; }
		if (HX_FIELD_EQ(inName,"get_pos") ) { return get_pos_dyn(); }
		if (HX_FIELD_EQ(inName,"set_pos") ) { return set_pos_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"get_grab") ) { return get_grab_dyn(); }
		if (HX_FIELD_EQ(inName,"get_lock") ) { return get_lock_dyn(); }
		if (HX_FIELD_EQ(inName,"set_grab") ) { return set_grab_dyn(); }
		if (HX_FIELD_EQ(inName,"set_lock") ) { return set_lock_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"get_visible") ) { return get_visible_dyn(); }
		if (HX_FIELD_EQ(inName,"set_visible") ) { return set_visible_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Cursor_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"pos") ) { if (inCallProp) return set_pos(inValue);pos=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"grab") ) { if (inCallProp) return set_grab(inValue);grab=inValue.Cast< bool >(); return inValue; }
		if (HX_FIELD_EQ(inName,"lock") ) { if (inCallProp) return set_lock(inValue);lock=inValue.Cast< bool >(); return inValue; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"screen") ) { screen=inValue.Cast< ::luxe::Screen >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"visible") ) { if (inCallProp) return set_visible(inValue);visible=inValue.Cast< bool >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void Cursor_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("screen"));
	outFields->push(HX_CSTRING("visible"));
	outFields->push(HX_CSTRING("grab"));
	outFields->push(HX_CSTRING("lock"));
	outFields->push(HX_CSTRING("pos"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsObject /*::luxe::Screen*/ ,(int)offsetof(Cursor_obj,screen),HX_CSTRING("screen")},
	{hx::fsBool,(int)offsetof(Cursor_obj,visible),HX_CSTRING("visible")},
	{hx::fsBool,(int)offsetof(Cursor_obj,grab),HX_CSTRING("grab")},
	{hx::fsBool,(int)offsetof(Cursor_obj,lock),HX_CSTRING("lock")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Cursor_obj,pos),HX_CSTRING("pos")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("screen"),
	HX_CSTRING("visible"),
	HX_CSTRING("grab"),
	HX_CSTRING("lock"),
	HX_CSTRING("pos"),
	HX_CSTRING("get_visible"),
	HX_CSTRING("set_visible"),
	HX_CSTRING("get_grab"),
	HX_CSTRING("get_lock"),
	HX_CSTRING("set_grab"),
	HX_CSTRING("set_lock"),
	HX_CSTRING("get_pos"),
	HX_CSTRING("set_pos"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(Cursor_obj::__mClass,"__mClass");
};

#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(Cursor_obj::__mClass,"__mClass");
};

#endif

Class Cursor_obj::__mClass;

void Cursor_obj::__register()
{
	hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("luxe.Cursor"), hx::TCanCast< Cursor_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
    , sMemberStorageInfo
#endif
);
}

void Cursor_obj::__boot()
{
}

} // end namespace luxe
