// File: /workspace/github_c_makefile_star2_O3/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 0x6f7c0
cmpq $0x0, 0x90(%rbx)
jne 0x6f7c0
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 0x6f7c0
movq 0x190(%rbx), %r14
movq 0xfc262(%rip), %rax     # 0x16b828
movswl (%rax), %ebp
leaq 0x20(%r14), %rdi
movl %ebp, %esi
callq 0x57520
testb %al, %al
jne 0x6f5e7
movq 0x190(%r14), %r14
testq %r14, %r14
jne 0x6f5c9
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 0x6f694
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 0x6f73d
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
callq *0xf0(%rax)
cvtsi2sd %eax, %xmm0
mulsd 0x86177(%rip), %xmm0    # 0xf57e8
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x8416b(%rip), %rcx     # 0xf37f0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
jmp 0x6f742
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x6f798
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 0x86103(%rip), %xmm0    # 0xf57e8
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm0, %xmm1
seta %dl
leaq 0x840f7(%rip), %rsi     # 0xf37f0
addsd (%rsi,%rdx,8), %xmm0
cvttsd2si %xmm0, %rdx
movq 0xfc7ee(%rip), %rsi     # 0x16bef8
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 0x6f787
movl $0x14, %eax
movq %r12, %rcx
shrq $0x20, %rcx
movq 0xfc7a8(%rip), %rdx     # 0x16bef8
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 0xfbfe9(%rip), %rdi     # 0x16b788
movq 0xfc81a(%rip), %rsi     # 0x16bfc0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x70500
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 0x6f7f4
jmp 0x6f7f4
jmp 0x6f7f4
jmp 0x6f7f4
jmp 0x6f7f4
movq %rax, %rbx
movl $0x5d8, %esi            # imm = 0x5D8
movq %r15, %rdi
callq 0x55480
jmp 0x6f7f7
jmp 0x6f7f4
jmp 0x6f7f4
jmp 0x6f804
movq %rax, %rbx
callq 0x56e90
movq %rbx, %rdi
callq 0x57090
movq %rax, %rdi
callq 0x5aeae