// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/gui/widgets/basic/slider.cpp
// Function: smooth::GUI::Slider::Slider(smooth::GUI::Point const&, smooth::GUI::Size const&, int, int*, int, int)
S::GUI::Slider::Slider(const Point &iPos, const Size &iSize, Int sType, Int *var, Int rangeStart, Int rangeEnd) : Widget(iPos, iSize)
{
	type		= classID;
	subtype		= sType;
	startValue	= rangeStart;
	endValue	= rangeEnd;

	dummyVariable	= 0;
	previousValue	= 0;

	gripSize	= 9;

	if (var == NIL)	variable = &dummyVariable;
	else		variable = var;

	if (GetWidth()	== 0 && subtype == OR_HORZ) SetWidth(100);
	if (GetHeight() == 0 && subtype == OR_VERT) SetHeight(100);

	if (subtype == OR_HORZ)	SetHeight(18);
	else			SetWidth(18);

	onValueChange.SetParentObject(this);
	onValueChange.Connect(&onAction);

	clickHotspot	= new Hotspot(subtype == OR_HORZ ? Point(4, 1) : Point(1, 4), GetSize() - (subtype == OR_HORZ ? Size(8, 2) : Size(2, 8)));
	dragHotspot	= new Hotspot(Point(), Size());

	dragging	= False;

	clickHotspot->onLeftButtonClick.Connect(&Slider::OnMouseClick, this);

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

	Add(clickHotspot);
	Add(dragHotspot);

	onChangeSize.Connect(&Slider::UpdateHotspotPositions, this);

	SetValue(*variable);

	UpdateHotspotPositions();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r9d, %r14d
movq %r8, %r15
movl %ecx, %ebp
movq %rdi, %rbx
movl 0x40(%rsp), %r12d
callq 0x58c80
movq 0xe7058(%rip), %rax     # 0x161d20
addq $0x10, %rax
movq %rax, (%rbx)
andq $0x0, 0x5f8(%rbx)
leaq 0xdd0ba(%rip), %rax     # 0x157d98
movq %rax, 0x5f0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x600(%rbx)
movq 0xe6ff2(%rip), %rax     # 0x161ce8
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
movw %bp, 0x1a0(%rbx)
movl %r14d, 0x5d8(%rbx)
movl %r12d, 0x5dc(%rbx)
andq $0x0, 0x5b8(%rbx)
leaq 0x5f0(%rbx), %r14
leaq 0x5b8(%rbx), %rax
movl $0x9, 0x5c8(%rbx)
testq %r15, %r15
cmovneq %r15, %rax
movq %rax, 0x5d0(%rbx)
cmpw $0x1, %bp
jne 0x7ad61
cmpl $0x0, 0xb0(%rbx)
jne 0x7ad61
pushq $0x64
popq %rsi
movq %rbx, %rdi
callq 0x5a1f0
movzwl 0x1a0(%rbx), %ebp
cmpl $0x0, 0xb4(%rbx)
sete %al
cmpw $0x2, %bp
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x7ad8b
pushq $0x64
popq %rsi
movq %rbx, %rdi
callq 0x58980
movzwl 0x1a0(%rbx), %ebp
cmpw $0x1, %bp
jne 0x7ad9e
pushq $0x12
popq %rsi
movq %rbx, %rdi
callq 0x58980
jmp 0x7ada9
pushq $0x12
popq %rsi
movq %rbx, %rdi
callq 0x5a1f0
movq %rbx, 0x5f8(%rbx)
leaq 0x478(%rbx), %rsi
movq %r14, %rdi
callq 0x72300
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x56700
movq %rax, %r15
xorl %eax, %eax
xorl %ecx, %ecx
cmpw $0x1, 0x1a0(%rbx)
setne %al
sete %cl
leal 0x1(%rcx,%rcx,2), %ecx
pushq $-0x2
popq %rdi
pushq $-0x8
popq %rdx
movl %edx, %r8d
cmovel %edi, %r8d
cmovel %edx, %edi
leal (%rax,%rax,2), %eax
incl %eax
leaq 0x8(%rsp), %rsi
movl %ecx, (%rsi)
movl %eax, 0x4(%rsi)
addl 0xb0(%rbx), %edi
addl 0xb4(%rbx), %r8d
shlq $0x20, %r8
orq %r8, %rdi
movq %rsp, %rdx
movq %rdi, (%rdx)
movq %r15, %rdi
callq 0x56aa0
movq %r15, 0x5e0(%rbx)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x56700
movq %rax, %r15
leaq 0x8(%rsp), %rsi
andq $0x0, (%rsi)
movq %rsp, %rdx
andq $0x0, (%rdx)
movq %rax, %rdi
callq 0x56aa0
movq %r15, 0x5e8(%rbx)
movb $0x0, 0x5c4(%rbx)
movl $0x338, %edi            # imm = 0x338
addq 0x5e0(%rbx), %rdi
movq 0xe6cd8(%rip), %rsi     # 0x161b48
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7b8c6
movl $0x3f8, %edi            # imm = 0x3F8
addq 0x5e8(%rbx), %rdi
movq 0xe7063(%rip), %rsi     # 0x161ef0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7b8c6
movl $0x418, %edi            # imm = 0x418
addq 0x5e8(%rbx), %rdi
movq 0xe660e(%rip), %rsi     # 0x1614b8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7b8c6
movl $0x438, %edi            # imm = 0x438
addq 0x5e8(%rbx), %rdi
movq 0xe7061(%rip), %rsi     # 0x161f28
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7b8c6
movq 0x5e0(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq 0x5e8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
leaq 0x298(%rbx), %rdi
movq 0xe7011(%rip), %rsi     # 0x161f10
xorl %edx, %edx
movq %rbx, %rcx
callq 0x7b962
movq 0x5d0(%rbx), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x56270
movq %rbx, %rdi
callq 0x5a580
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7af31
movq %rax, %r12
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x564c0
jmp 0x7af46
movq %rax, %r12
movq %r14, %rdi
callq 0x724c6
movq %rbx, %rdi
callq 0x58860
movq %r12, %rdi
callq 0x58260