// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/gui/widgets/widget.cpp
// Function: smooth::GUI::Widget::ActivateTooltip()
S::Void S::GUI::Widget::ActivateTooltip()
{
	Application::Lock	 lock;

	if (tipTimer == NIL || tooltip != NIL) return;

	tipTimer->Stop();

	DeleteObject(tipTimer);

	tipTimer = NIL;

	if (IsVisible())
	{
		Window	*window	= container->GetContainerWindow();

		tooltip = new Tooltip();

		if (tooltipText != NIL)
		{
			tooltip->SetText(tooltipText);
			tooltip->SetMetrics(window->GetMousePosition() - Point(tooltip->GetUnscaledTextWidth() > 0 ? Math::Round(0.2 * tooltip->GetUnscaledTextWidth()) : 20, Setup::HoverHeight / 2 + 1), Size(0, 0));
			tooltip->SetTimeout(3000);
		}
		else if (tooltipLayer != NIL)
		{
			tooltipLayer->Show();

			tooltip->SetLayer(tooltipLayer);
			tooltip->SetPosition(window->GetMousePosition() - Point(Math::Round(0.2 * tooltipLayer->GetWidth()), Setup::HoverHeight / 2 + 1));
			tooltip->SetTimeout(3000);
		}

		PopupMenu::internalOnOpenPopupMenu.Connect(&Widget::DeactivateTooltip, this);

		window->Add(tooltip);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x55420
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x6fa52
cmpq $0x0, 0x90(%rbx)
jne 0x6fa52
callq 0x59190
movq 0xa0(%rbx), %rdi
callq 0x58cc0
movq $0x0, 0xa0(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
testb %al, %al
je 0x6fa52
movq 0x190(%rbx), %r14
movq 0xfcfd0(%rip), %rax     # 0x16c828
movswl (%rax), %ebp
leaq 0x20(%r14), %rdi
movl %ebp, %esi
callq 0x57520
testb %al, %al
jne 0x6f879
movq 0x190(%r14), %r14
testq %r14, %r14
jne 0x6f85b
xorl %r14d, %r14d
movl $0x5d8, %edi            # imm = 0x5D8
callq 0x556b0
movq %rax, %r15
movq %rax, %rdi
callq 0x57a20
movq %r15, 0x90(%rbx)
leaq 0x120(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x56bd0
testb %al, %al
je 0x6f926
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0xa0(%rax)
movq 0x90(%rbx), %r15
movq %r14, %rdi
callq 0x56b50
movq %rax, %r12
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
callq *0xf0(%rax)
testl %eax, %eax
jle 0x6f9cf
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
callq *0xf0(%rax)
cvtsi2sd %eax, %xmm0
mulsd 0x86e75(%rip), %xmm0    # 0xf6778
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x84fa9(%rip), %rcx     # 0xf48c0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
jmp 0x6f9d4
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x6fa2a
movq (%rdi), %rax
callq *0x58(%rax)
movq 0x90(%rbx), %r15
movq 0x138(%rbx), %rax
movq %rax, 0x5d0(%r15)
movq %r14, %rdi
callq 0x56b50
movq %rax, %rcx
shrq $0x20, %rcx
movq 0x138(%rbx), %rdx
cvtsi2sdl 0xb0(%rdx), %xmm0
mulsd 0x86e01(%rip), %xmm0    # 0xf6778
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm0, %xmm1
seta %dl
leaq 0x84f35(%rip), %rsi     # 0xf48c0
addsd (%rsi,%rdx,8), %xmm0
cvttsd2si %xmm0, %rdx
movq 0xfd55c(%rip), %rsi     # 0x16cef8
movl (%rsi), %esi
movl %esi, %edi
shrl $0x1f, %edi
addl %esi, %edi
sarl %edi
notl %edi
subl %edx, %eax
addl %ecx, %edi
shlq $0x20, %rdi
orq %rdi, %rax
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0xb0(%r15), %rdx
movq (%r15), %rax
movq %r15, %rdi
callq *0x150(%rax)
jmp 0x6fa19
movl $0x14, %eax
movq %r12, %rcx
shrq $0x20, %rcx
movq 0xfd516(%rip), %rdx     # 0x16cef8
movl (%rdx), %edx
movl %edx, %esi
shrl $0x1f, %esi
addl %edx, %esi
sarl %esi
notl %esi
subl %eax, %r12d
addl %ecx, %esi
shlq $0x20, %rsi
orq %rsi, %r12
movq %rsp, %rsi
movq %r12, (%rsi)
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
movq (%r15), %rax
movq %r15, %rdi
callq *0x150(%rax)
movq 0x90(%rbx), %rax
movl $0xbb8, 0x5c8(%rax)     # imm = 0xBB8
movq 0xfcd57(%rip), %rdi     # 0x16c788
movq 0xfd588(%rip), %rsi     # 0x16cfc0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x707b6
movq 0x90(%rbx), %rsi
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
callq 0x56e90
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6fa86
jmp 0x6fa86
jmp 0x6fa86
jmp 0x6fa86
jmp 0x6fa86
movq %rax, %rbx
movl $0x5d8, %esi            # imm = 0x5D8
movq %r15, %rdi
callq 0x55480
jmp 0x6fa89
jmp 0x6fa86
jmp 0x6fa86
jmp 0x6fa96
movq %rax, %rbx
callq 0x56e90
movq %rbx, %rdi
callq 0x57090
movq %rax, %rdi
callq 0x5aede