// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/gui/widgets/basic/scrollbar.cpp
// Function: smooth::GUI::Scrollbar::Scrollbar(smooth::GUI::Point const&, smooth::GUI::Size const&, int, int*, int, int)
S::GUI::Scrollbar::Scrollbar(const Point &iPos, const Size &iSize, Int sType, Int *var, Int rangeStart, Int rangeEnd) : Arrows(iPos, iSize, sType, var, rangeStart, rangeEnd)
{
	type		= classID;

	if (GetWidth()	== 0) SetWidth(subtype	== OR_VERT ? 17  : 120);
	if (GetHeight()	== 0) SetHeight(subtype	== OR_VERT ? 120 :  17);

	clickHotspot	= new Hotspot(Point(), Size());
	dragHotspot	= new Hotspot(Point(), Size());

	clickTimer	= new System::Timer();
	clickTimerDirection = 1;

	pageSize	= 6;

	dragging	= False;
	clickOffset	= 0;

	scrollSpill	= 0;

	clickHotspot->onLeftButtonDown.Connect(&Scrollbar::OnMouseClick, this);
	clickHotspot->onLeftButtonUp.Connect(&System::Timer::Stop, clickTimer);
	clickHotspot->onMouseOut.Connect(&System::Timer::Stop, clickTimer);

	dragHotspot->onMouseDragStart.Connect(&Scrollbar::OnMouseDragStart, this);
	dragHotspot->onMouseDrag.Connect(&Scrollbar::OnMouseDrag, this);
	dragHotspot->onMouseDragEnd.Connect(&Scrollbar::OnMouseDragEnd, this);

	dragHotspot->onMouseWheel.Connect(&Scrollbar::OnMouseWheel, this);

	clickTimer->onInterval.Connect(&Scrollbar::OnMouseClickTimer, this);

	Add(clickHotspot);
	Add(dragHotspot);

	UpdateHotspotPositions();

	onRangeChange.Connect(&Scrollbar::OnValueChange, this);
	onValueChange.Connect(&Scrollbar::OnValueChange, this);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl 0x40(%rsp), %eax
movl %eax, (%rsp)
callq 0x558e0
movq 0xf13fd(%rip), %rax     # 0x16be40
addq $0x10, %rax
movq %rax, (%rbx)
movq 0xf0a07(%rip), %rax     # 0x16b458
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
cmpl $0x0, 0xb0(%rbx)
jne 0x7aa95
cmpw $0x2, 0x1a0(%rbx)
movl $0x11, %eax
movl $0x78, %ecx
cmovel %eax, %ecx
leaq 0xa8(%rbx), %rsi
movl 0xb4(%rbx), %eax
leaq 0x10(%rsp), %rdx
movl %ecx, (%rdx)
movl %eax, 0x4(%rdx)
movq %rbx, %rdi
callq 0x57080
cmpl $0x0, 0xb4(%rbx)
jne 0x7aad6
cmpw $0x2, 0x1a0(%rbx)
movl $0x78, %eax
movl $0x11, %ecx
cmovel %eax, %ecx
leaq 0xa8(%rbx), %rsi
movl 0xb0(%rbx), %eax
leaq 0x10(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %r15
xorl %eax, %eax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq %r15, %rdi
callq 0x55a30
movq %r15, 0x658(%rbx)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %r15
xorl %eax, %eax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq %r15, %rdi
callq 0x55a30
movq %r15, 0x660(%rbx)
movl $0x68, %edi
callq 0x556b0
movq %rax, %r15
movq %rax, %rdi
callq 0x55b80
movq %r15, 0x648(%rbx)
movabsq $0x600000001, %rax      # imm = 0x600000001
movq %rax, 0x650(%rbx)
movb $0x0, 0x638(%rbx)
movl $0x0, 0x63c(%rbx)
movq $0x0, 0x640(%rbx)
movl $0x2f8, %edi            # imm = 0x2F8
addq 0x658(%rbx), %rdi
movq 0xf0c02(%rip), %rsi     # 0x16b790
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bbc8
movl $0x318, %edi            # imm = 0x318
addq 0x658(%rbx), %rdi
movq 0x648(%rbx), %rcx
movq 0xf0efe(%rip), %rsi     # 0x16bab0
xorl %edx, %edx
callq 0x7bc88
movl $0x2d8, %edi            # imm = 0x2D8
addq 0x658(%rbx), %rdi
movq 0x648(%rbx), %rcx
movq 0xf0edd(%rip), %rsi     # 0x16bab0
xorl %edx, %edx
callq 0x7bd48
movl $0x3f8, %edi            # imm = 0x3F8
addq 0x660(%rbx), %rdi
movq 0xf0853(%rip), %rsi     # 0x16b440
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bbc8
movl $0x418, %edi            # imm = 0x418
addq 0x660(%rbx), %rdi
movq 0xf13d6(%rip), %rsi     # 0x16bfe0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bbc8
movl $0x438, %edi            # imm = 0x438
addq 0x660(%rbx), %rdi
movq 0xf09e1(%rip), %rsi     # 0x16b608
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bbc8
movl $0x458, %edi            # imm = 0x458
addq 0x660(%rbx), %rdi
movq 0xf0894(%rip), %rsi     # 0x16b4d8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7be08
movq 0x648(%rbx), %rdi
addq $0x48, %rdi
movq 0xf1240(%rip), %rsi     # 0x16bea0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bec8
movq 0x658(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq 0x660(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
callq 0x58280
leaq 0x5f8(%rbx), %rdi
movq 0xf0f38(%rip), %rsi     # 0x16bbd8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bf88
leaq 0x618(%rbx), %rdi
movq 0xf0f20(%rip), %rsi     # 0x16bbd8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7c048
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x68, %esi
jmp 0x7ace0
jmp 0x7acd8
movq %rax, %r14
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x55480
jmp 0x7aced
movq %rax, %r14
movq %rbx, %rdi
callq 0x58310
movq %r14, %rdi
callq 0x57090
nop