// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x56460
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x6f78c
cmpq $0x0, 0x90(%rbx)
jne 0x6f78c
callq 0x5a518
movq 0xa0(%rbx), %rdi
callq 0x5a010
andq $0x0, 0xa0(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
testb %al, %al
je 0x6f78c
movq 0x190(%rbx), %rdi
callq 0x56a50
movq %rax, %r14
movl $0x5d8, %edi            # imm = 0x5D8
callq 0x56700
movq %rax, %r15
movq %rax, %rdi
callq 0x58c70
movq %r15, 0x90(%rbx)
leaq 0x120(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x57d40
testb %al, %al
je 0x6f662
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0xa0(%rax)
movq 0x90(%rbx), %r15
movq %r14, %rdi
callq 0x57cc0
movq %rax, %r12
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
callq *0xf0(%rax)
testl %eax, %eax
jle 0x6f70f
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
callq *0xf0(%rax)
cvtsi2sd %eax, %xmm0
mulsd 0x76189(%rip), %xmm0    # 0xe57c8
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x7415d(%rip), %rcx     # 0xe37b0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rcx
jmp 0x6f712
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x6f764
movq (%rdi), %rax
callq *0x58(%rax)
movq 0x90(%rbx), %r15
movq 0x138(%rbx), %rax
movq %rax, 0x5d0(%r15)
movq %r14, %rdi
callq 0x57cc0
movq %rax, %rcx
movq %rax, %rsi
shrq $0x20, %rsi
movq 0x138(%rbx), %rax
cvtsi2sdl 0xb0(%rax), %xmm0
mulsd 0x76112(%rip), %xmm0    # 0xe57c8
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x740e6(%rip), %rdx     # 0xe37b0
addsd (%rdx,%rax,8), %xmm0
cvttsd2si %xmm0, %rdi
movq 0xf281d(%rip), %rax     # 0x161ef8
movl (%rax), %eax
pushq $0x2
popq %r8
cltd
idivl %r8d
notl %eax
subl %edi, %ecx
addl %esi, %eax
shlq $0x20, %rax
orq %rax, %rcx
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
leaq 0xb0(%r15), %rdx
movq (%r15), %rax
movq %r15, %rdi
callq *0x150(%rax)
jmp 0x6f753
pushq $0x14
popq %rcx
movq %r12, %rsi
shrq $0x20, %rsi
movq 0xf27d8(%rip), %rax     # 0x161ef8
movl (%rax), %eax
pushq $0x2
popq %rdi
cltd
idivl %edi
notl %eax
subl %ecx, %r12d
addl %esi, %eax
shlq $0x20, %rax
orq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %r12, (%rsi)
leaq 0x10(%rsp), %rdx
andq $0x0, (%rdx)
movq (%r15), %rax
movq %r15, %rdi
callq *0x150(%rax)
movq 0x90(%rbx), %rax
movl $0xbb8, 0x5c8(%rax)     # imm = 0xBB8
movq 0xf201d(%rip), %rdi     # 0x161788
movq 0xf284e(%rip), %rsi     # 0x161fc0
xorl %edx, %edx
movq %rbx, %rcx
callq 0x70448
movq 0x90(%rbx), %rsi
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
leaq 0x7(%rsp), %rdi
callq 0x563d0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x6f7c0
jmp 0x6f7c0
jmp 0x6f7c0
jmp 0x6f7c0
jmp 0x6f7c0
movq %rax, %rbx
movl $0x5d8, %esi            # imm = 0x5D8
movq %r15, %rdi
callq 0x564c0
jmp 0x6f7c3
jmp 0x6f7c0
movq %rax, %rbx
leaq 0x7(%rsp), %rdi
callq 0x563d0
movq %rbx, %rdi
callq 0x58260
nop