// Generated by Haxe 3.3.0
#include <hxcpp.h>

#include "hxMath.h"
#ifndef INCLUDED_flixel_system_debug_completion_CompletionListScrollBar
#include <flixel/system/debug/completion/CompletionListScrollBar.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_Bitmap
#include <openfl/_legacy/display/Bitmap.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_BitmapData
#include <openfl/_legacy/display/BitmapData.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_DisplayObject
#include <openfl/_legacy/display/DisplayObject.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_DisplayObjectContainer
#include <openfl/_legacy/display/DisplayObjectContainer.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_IBitmapDrawable
#include <openfl/_legacy/display/IBitmapDrawable.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_InteractiveObject
#include <openfl/_legacy/display/InteractiveObject.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_PixelSnapping
#include <openfl/_legacy/display/PixelSnapping.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_Sprite
#include <openfl/_legacy/display/Sprite.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_EventDispatcher
#include <openfl/_legacy/events/EventDispatcher.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_IEventDispatcher
#include <openfl/_legacy/events/IEventDispatcher.h>
#endif

namespace flixel{
namespace _hx_system{
namespace debug{
namespace completion{

void CompletionListScrollBar_obj::__construct(Int x,Int y,Int width,Int height){
            	HX_STACK_FRAME("flixel.system.debug.completion.CompletionListScrollBar","new",0xf77443d4,"flixel.system.debug.completion.CompletionListScrollBar.new","flixel/system/debug/completion/CompletionListScrollBar.hx",16,0x884a099c)
            	HX_STACK_THIS(this)
            	HX_STACK_ARG(x,"x")
            	HX_STACK_ARG(y,"y")
            	HX_STACK_ARG(width,"width")
            	HX_STACK_ARG(height,"height")
HXLINE(  17)		super::__construct();
HXLINE(  19)		this->set_x(x);
HXLINE(  20)		this->set_y(y);
HXLINE(  22)		this->addChild( ::openfl::_legacy::display::Bitmap_obj::__new( ::openfl::_legacy::display::BitmapData_obj::__new(width,height,true,(int)-12303292,null()),null(),null()));
HXLINE(  23)		this->handle =  ::openfl::_legacy::display::Bitmap_obj::__new( ::openfl::_legacy::display::BitmapData_obj::__new(width,(int)1,true,(int)-14540254,null()),null(),null());
HXLINE(  24)		this->addChild(this->handle);
            	}

Dynamic CompletionListScrollBar_obj::__CreateEmpty() { return new CompletionListScrollBar_obj; }

hx::ObjectPtr< CompletionListScrollBar_obj > CompletionListScrollBar_obj::__new(Int x,Int y,Int width,Int height)
{
	hx::ObjectPtr< CompletionListScrollBar_obj > _hx_result = new CompletionListScrollBar_obj();
	_hx_result->__construct(x,y,width,height);
	return _hx_result;
}

Dynamic CompletionListScrollBar_obj::__Create(hx::DynamicArray inArgs)
{
	hx::ObjectPtr< CompletionListScrollBar_obj > _hx_result = new CompletionListScrollBar_obj();
	_hx_result->__construct(inArgs[0],inArgs[1],inArgs[2],inArgs[3]);
	return _hx_result;
}

void CompletionListScrollBar_obj::updateHandle(Int lower,Int items,Int entries){
            	HX_STACK_FRAME("flixel.system.debug.completion.CompletionListScrollBar","updateHandle",0x7238a89d,"flixel.system.debug.completion.CompletionListScrollBar.updateHandle","flixel/system/debug/completion/CompletionListScrollBar.hx",28,0x884a099c)
            	HX_STACK_THIS(this)
            	HX_STACK_ARG(lower,"lower")
            	HX_STACK_ARG(items,"items")
            	HX_STACK_ARG(entries,"entries")
HXLINE(  29)		Float _hx_tmp = this->get_height();
HXDLIN(  29)		Float _hx_tmp1 = (((Float)_hx_tmp / (Float)items) * entries);
HXDLIN(  29)		Float _hx_tmp2 = this->get_height();
HXDLIN(  29)		Float _hx_tmp3 = ::Math_obj::min(_hx_tmp1,_hx_tmp2);
HXDLIN(  29)		this->handle->set_scaleY(_hx_tmp3);
HXLINE(  30)		Float _hx_tmp4 = this->get_height();
HXDLIN(  30)		this->handle->set_y((((Float)_hx_tmp4 / (Float)items) * lower));
HXLINE(  31)		HX_VARI( Float,Value) = this->handle->get_y();
HXDLIN(  31)		Float _hx_tmp5 = this->get_height();
HXDLIN(  31)		Float _hx_tmp6 = this->handle->get_scaleY();
HXDLIN(  31)		HX_VARI(  ::Dynamic,Max) = (_hx_tmp5 - _hx_tmp6);
HXDLIN(  31)		HX_VAR( Float,lowerBound);
HXDLIN(  31)		if ((Value < (int)0)) {
HXLINE(  31)			lowerBound = (int)0;
            		}
            		else {
HXLINE(  31)			lowerBound = Value;
            		}
HXDLIN(  31)		Float _hx_tmp7;
HXDLIN(  31)		Bool _hx_tmp8;
HXDLIN(  31)		Bool _hx_tmp9 = hx::IsNotNull( Max );
HXDLIN(  31)		if (_hx_tmp9) {
HXLINE(  31)			_hx_tmp8 = hx::IsGreater( lowerBound,Max );
            		}
            		else {
HXLINE(  31)			_hx_tmp8 = false;
            		}
HXDLIN(  31)		if (_hx_tmp8) {
HXLINE(  31)			_hx_tmp7 = Max;
            		}
            		else {
HXLINE(  31)			_hx_tmp7 = lowerBound;
            		}
HXDLIN(  31)		this->handle->set_y(_hx_tmp7);
            	}


HX_DEFINE_DYNAMIC_FUNC3(CompletionListScrollBar_obj,updateHandle,(void))

Int CompletionListScrollBar_obj::BG_COLOR;

Int CompletionListScrollBar_obj::HANDLE_COLOR;


CompletionListScrollBar_obj::CompletionListScrollBar_obj()
{
}

void CompletionListScrollBar_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(CompletionListScrollBar);
	HX_MARK_MEMBER_NAME(handle,"handle");
	 ::openfl::_legacy::display::DisplayObjectContainer_obj::__Mark(HX_MARK_ARG);
	HX_MARK_END_CLASS();
}

void CompletionListScrollBar_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(handle,"handle");
	 ::openfl::_legacy::display::DisplayObjectContainer_obj::__Visit(HX_VISIT_ARG);
}

hx::Val CompletionListScrollBar_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
	switch(inName.length) {
	case 6:
		if (HX_FIELD_EQ(inName,"handle") ) { return hx::Val( handle); }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"updateHandle") ) { return hx::Val( updateHandle_dyn()); }
	}
	return super::__Field(inName,inCallProp);
}

hx::Val CompletionListScrollBar_obj::__SetField(const ::String &inName,const hx::Val &inValue,hx::PropertyAccess inCallProp)
{
	switch(inName.length) {
	case 6:
		if (HX_FIELD_EQ(inName,"handle") ) { handle=inValue.Cast<  ::openfl::_legacy::display::Bitmap >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void CompletionListScrollBar_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_HCSTRING("handle","\xa8","\x83","\xfd","\xb7"));
	super::__GetFields(outFields);
};

#if HXCPP_SCRIPTABLE
static hx::StorageInfo CompletionListScrollBar_obj_sMemberStorageInfo[] = {
	{hx::fsObject /*::openfl::_legacy::display::Bitmap*/ ,(int)offsetof(CompletionListScrollBar_obj,handle),HX_HCSTRING("handle","\xa8","\x83","\xfd","\xb7")},
	{ hx::fsUnknown, 0, null()}
};
static hx::StaticInfo CompletionListScrollBar_obj_sStaticStorageInfo[] = {
	{hx::fsInt,(void *) &CompletionListScrollBar_obj::BG_COLOR,HX_HCSTRING("BG_COLOR","\x09","\x4c","\xa7","\x0b")},
	{hx::fsInt,(void *) &CompletionListScrollBar_obj::HANDLE_COLOR,HX_HCSTRING("HANDLE_COLOR","\x2c","\x4e","\x95","\xc9")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String CompletionListScrollBar_obj_sMemberFields[] = {
	HX_HCSTRING("handle","\xa8","\x83","\xfd","\xb7"),
	HX_HCSTRING("updateHandle","\x91","\x2a","\xc1","\xb7"),
	::String(null()) };

static void CompletionListScrollBar_obj_sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(CompletionListScrollBar_obj::__mClass,"__mClass");
	HX_MARK_MEMBER_NAME(CompletionListScrollBar_obj::BG_COLOR,"BG_COLOR");
	HX_MARK_MEMBER_NAME(CompletionListScrollBar_obj::HANDLE_COLOR,"HANDLE_COLOR");
};

#ifdef HXCPP_VISIT_ALLOCS
static void CompletionListScrollBar_obj_sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(CompletionListScrollBar_obj::__mClass,"__mClass");
	HX_VISIT_MEMBER_NAME(CompletionListScrollBar_obj::BG_COLOR,"BG_COLOR");
	HX_VISIT_MEMBER_NAME(CompletionListScrollBar_obj::HANDLE_COLOR,"HANDLE_COLOR");
};

#endif

hx::Class CompletionListScrollBar_obj::__mClass;

static ::String CompletionListScrollBar_obj_sStaticFields[] = {
	HX_HCSTRING("BG_COLOR","\x09","\x4c","\xa7","\x0b"),
	HX_HCSTRING("HANDLE_COLOR","\x2c","\x4e","\x95","\xc9"),
	::String(null())
};

void CompletionListScrollBar_obj::__register()
{
	hx::Static(__mClass) = new hx::Class_obj();
	__mClass->mName = HX_HCSTRING("flixel.system.debug.completion.CompletionListScrollBar","\xe2","\x09","\x71","\x90");
	__mClass->mSuper = &super::__SGetClass();
	__mClass->mConstructEmpty = &__CreateEmpty;
	__mClass->mConstructArgs = &__Create;
	__mClass->mGetStaticField = &hx::Class_obj::GetNoStaticField;
	__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
	__mClass->mMarkFunc = CompletionListScrollBar_obj_sMarkStatics;
	__mClass->mStatics = hx::Class_obj::dupFunctions(CompletionListScrollBar_obj_sStaticFields);
	__mClass->mMembers = hx::Class_obj::dupFunctions(CompletionListScrollBar_obj_sMemberFields);
	__mClass->mCanCast = hx::TCanCast< CompletionListScrollBar_obj >;
#ifdef HXCPP_VISIT_ALLOCS
	__mClass->mVisitFunc = CompletionListScrollBar_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mMemberStorageInfo = CompletionListScrollBar_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mStaticStorageInfo = CompletionListScrollBar_obj_sStaticStorageInfo;
#endif
	hx::_hx_RegisterClass(__mClass->mName, __mClass);
}

void CompletionListScrollBar_obj::__boot()
{
{
            	HX_STACK_FRAME("flixel.system.debug.completion.CompletionListScrollBar","boot",0x8660163e,"flixel.system.debug.completion.CompletionListScrollBar.boot","flixel/system/debug/completion/CompletionListScrollBar.hx",10,0x884a099c)
HXLINE(  10)		BG_COLOR = (int)-12303292;
            	}
{
            	HX_STACK_FRAME("flixel.system.debug.completion.CompletionListScrollBar","boot",0x8660163e,"flixel.system.debug.completion.CompletionListScrollBar.boot","flixel/system/debug/completion/CompletionListScrollBar.hx",11,0x884a099c)
HXLINE(  11)		HANDLE_COLOR = (int)-14540254;
            	}
}

} // end namespace flixel
} // end namespace system
} // end namespace debug
} // end namespace completion
