// File: /workspace/github_c_makefile_star2_O1/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 0xf20f1(%rip), %rax     # 0x16ce40
addq $0x10, %rax
movq %rax, (%rbx)
movq 0xf16fb(%rip), %rax     # 0x16c458
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
cmpl $0x0, 0xb0(%rbx)
jne 0x7ada1
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 0x7ade2
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 0xf18f6(%rip), %rsi     # 0x16c790
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bfa8
movl $0x318, %edi            # imm = 0x318
addq 0x658(%rbx), %rdi
movq 0x648(%rbx), %rcx
movq 0xf1bf2(%rip), %rsi     # 0x16cab0
xorl %edx, %edx
callq 0x7c066
movl $0x2d8, %edi            # imm = 0x2D8
addq 0x658(%rbx), %rdi
movq 0x648(%rbx), %rcx
movq 0xf1bd1(%rip), %rsi     # 0x16cab0
xorl %edx, %edx
callq 0x7c124
movl $0x3f8, %edi            # imm = 0x3F8
addq 0x660(%rbx), %rdi
movq 0xf1547(%rip), %rsi     # 0x16c440
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bfa8
movl $0x418, %edi            # imm = 0x418
addq 0x660(%rbx), %rdi
movq 0xf20ca(%rip), %rsi     # 0x16cfe0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bfa8
movl $0x438, %edi            # imm = 0x438
addq 0x660(%rbx), %rdi
movq 0xf16d5(%rip), %rsi     # 0x16c608
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7bfa8
movl $0x458, %edi            # imm = 0x458
addq 0x660(%rbx), %rdi
movq 0xf1588(%rip), %rsi     # 0x16c4d8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7c1e2
movq 0x648(%rbx), %rdi
addq $0x48, %rdi
movq 0xf1f34(%rip), %rsi     # 0x16cea0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7c2a0
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 0xf1c2c(%rip), %rsi     # 0x16cbd8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7c35e
leaq 0x618(%rbx), %rdi
movq 0xf1c14(%rip), %rsi     # 0x16cbd8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7c41c
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x68, %esi
jmp 0x7afec
jmp 0x7afe4
movq %rax, %r14
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x55480
jmp 0x7aff9
movq %rax, %r14
movq %rbx, %rdi
callq 0x58310
movq %r14, %rdi
callq 0x57090
nop