// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x40(%rsp), %eax
movl %eax, (%rsp)
callq 0x56940
movq 0xe88bc(%rip), %rax     # 0x161e40
addq $0x10, %rax
movq %rax, (%rbx)
movq 0xe7ec6(%rip), %rax     # 0x161458
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
cmpl $0x0, 0xb0(%rbx)
pushq $0x11
popq %rbp
pushq $0x78
popq %r14
jne 0x795bf
cmpw $0x2, 0x1a0(%rbx)
movl %r14d, %esi
cmovel %ebp, %esi
movq %rbx, %rdi
callq 0x5a1f0
cmpl $0x0, 0xb4(%rbx)
jne 0x795de
cmpw $0x2, 0x1a0(%rbx)
cmovel %r14d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x58980
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x56700
movq %rax, %r15
leaq 0x10(%rsp), %rsi
andq $0x0, (%rsi)
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
movq %rax, %rdi
callq 0x56aa0
movq %r15, 0x658(%rbx)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x56700
movq %rax, %r15
leaq 0x10(%rsp), %rsi
andq $0x0, (%rsi)
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
movq %rax, %rdi
callq 0x56aa0
movq %r15, 0x660(%rbx)
pushq $0x68
popq %rdi
callq 0x56700
movq %rax, %r15
movq %rax, %rdi
callq 0x56c00
movq %r15, 0x648(%rbx)
movabsq $0x600000001, %rax      # imm = 0x600000001
movq %rax, 0x650(%rbx)
movb $0x0, 0x638(%rbx)
andl $0x0, 0x63c(%rbx)
andq $0x0, 0x640(%rbx)
movl $0x2f8, %edi            # imm = 0x2F8
addq 0x658(%rbx), %rdi
movq 0xe8102(%rip), %rsi     # 0x161790
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7a6c0
movl $0x318, %edi            # imm = 0x318
addq 0x658(%rbx), %rdi
movq 0x648(%rbx), %rcx
movq 0xe83fe(%rip), %rsi     # 0x161ab0
xorl %edx, %edx
callq 0x7a75c
movl $0x2d8, %edi            # imm = 0x2D8
addq 0x658(%rbx), %rdi
movq 0x648(%rbx), %rcx
movq 0xe83dd(%rip), %rsi     # 0x161ab0
xorl %edx, %edx
callq 0x7a7f8
movl $0x3f8, %edi            # imm = 0x3F8
addq 0x660(%rbx), %rdi
movq 0xe7d53(%rip), %rsi     # 0x161440
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7a6c0
movl $0x418, %edi            # imm = 0x418
addq 0x660(%rbx), %rdi
movq 0xe88d6(%rip), %rsi     # 0x161fe0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7a6c0
movl $0x438, %edi            # imm = 0x438
addq 0x660(%rbx), %rdi
movq 0xe7ee1(%rip), %rsi     # 0x161608
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7a6c0
movl $0x458, %edi            # imm = 0x458
addq 0x660(%rbx), %rdi
movq 0xe7d94(%rip), %rsi     # 0x1614d8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7a894
movq 0x648(%rbx), %rdi
addq $0x48, %rdi
movq 0xe8740(%rip), %rsi     # 0x161ea0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7a930
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 0x59530
leaq 0x5f8(%rbx), %rdi
movq 0xe8438(%rip), %rsi     # 0x161bd8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7a9cc
leaq 0x618(%rbx), %rdi
movq 0xe8420(%rip), %rsi     # 0x161bd8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7aa68
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x68
popq %rsi
jmp 0x797df
jmp 0x797d7
movq %rax, %r14
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x564c0
jmp 0x797ec
movq %rax, %r14
movq %rbx, %rdi
callq 0x595c0
movq %r14, %rdi
callq 0x58260