// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/gui/widgets/basic/multiedit.cpp
// Function: smooth::GUI::MultiEdit::MultiEdit(smooth::GUI::Point const&, smooth::GUI::Size const&, int)
S::GUI::MultiEdit::MultiEdit(const Point &iPos, const Size &iSize, Int maxSize) : Widget(iPos, iSize)
{
	type		= classID;

	scrollbar	= NIL;
	scrollbarPos	= 0;

	font.SetColor(Setup::ClientTextColor);

	if (GetWidth()	== 0) SetWidth(80);
	if (GetHeight() == 0) SetHeight(19);

	cursor = new Cursor(Point(3, Math::Ceil(Float(19 - font.GetUnscaledTextSizeY()) / 2) - 2),
			    GetSize() - Size(6, Math::Ceil(Float(19 - font.GetUnscaledTextSizeY()) / 2) - 1));
	cursor->onScroll.Connect(&MultiEdit::OnCursorScroll, this);
	cursor->SetMaxSize(maxSize);
	cursor->SetBackgroundColor(Setup::ClientColor);
	cursor->SetFlags(CF_MULTILINE);
	cursor->SetFont(font);
	cursor->onInput.Connect(&onInput);

	Add(cursor);

	onInput.SetParentObject(this);

	onChangeSize.Connect(&MultiEdit::OnChangeSize, this);
	onLoseFocus.Connect(&cursor->onLoseFocus);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdi, %rbx
callq 0x57a30
movq 0xf301b(%rip), %rax     # 0x16b390
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x5d0(%rbx), %r14
xorl %eax, %eax
movq %rax, 0x5d8(%rbx)
leaq 0xea42d(%rip), %rcx     # 0x1627c0
movq %rcx, 0x5d0(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x5e0(%rbx)
movq 0xf36b3(%rip), %rcx     # 0x16ba60
movzwl (%rcx), %ecx
movw %cx, 0x20(%rbx)
movq %rax, 0x5c0(%rbx)
movl $0x0, 0x5c8(%rbx)
leaq 0x140(%rbx), %r15
movq 0xf3a1d(%rip), %rsi     # 0x16bdf0
movq %r15, %rdi
callq 0x58650
cmpl $0x0, 0xb0(%rbx)
jne 0x78409
leaq 0xa8(%rbx), %rsi
movl 0xb4(%rbx), %eax
movq %rsp, %rdx
movl $0x50, (%rdx)
movl %eax, 0x4(%rdx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
cmpl $0x0, 0xb4(%rbx)
jne 0x78437
leaq 0xa8(%rbx), %rsi
movl 0xb0(%rbx), %eax
movq %rsp, %rdx
movl %eax, (%rdx)
movl $0x13, 0x4(%rdx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
movl $0x768, %edi            # imm = 0x768
callq 0x556b0
movq %rax, %r12
movq 0xf396d(%rip), %rsi     # 0x16bdb8
movq %r15, %rdi
callq 0x58a50
movl $0x13, %ecx
subl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x7af2f(%rip), %xmm0    # 0xf3398
callq 0x56cb0
addl $-0x2, %eax
movl $0x3, (%rsp)
movl %eax, 0x4(%rsp)
movq 0xf3935(%rip), %rsi     # 0x16bdb8
movq %r15, %rdi
callq 0x58a50
movl $0x13, %ecx
subl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x7aef7(%rip), %xmm0    # 0xf3398
callq 0x56cb0
movl 0xb0(%rbx), %ecx
movl 0xb4(%rbx), %edx
addl $-0x6, %ecx
subl %eax, %edx
incl %edx
shlq $0x20, %rdx
orq %rdx, %rcx
leaq 0x8(%rsp), %rdx
movq %rcx, (%rdx)
movq %rsp, %rsi
movq %r12, %rdi
callq 0x55c70
movq %r12, 0x5b8(%rbx)
addq $0x748, %r12            # imm = 0x748
movq 0xf37a0(%rip), %rsi     # 0x16bc88
movq %r12, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x78df4
movq 0x5b8(%rbx), %rdi
movl %ebp, %esi
callq 0x580f0
movq 0x5b8(%rbx), %rdi
movq (%rdi), %rax
movq 0xf315c(%rip), %rsi     # 0x16b670
callq *0x138(%rax)
movq 0x5b8(%rbx), %rdi
movl $0x1, 0x30(%rdi)
movq (%rdi), %rax
movq %r15, %rsi
callq *0xe0(%rax)
movl $0x708, %edi            # imm = 0x708
addq 0x5b8(%rbx), %rdi
movq %r14, %rsi
callq 0x763d8
movq 0x5b8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq %rbx, 0x5d8(%rbx)
leaq 0x298(%rbx), %rdi
movq 0xf3a03(%rip), %rsi     # 0x16bf70
xorl %edx, %edx
movq %rbx, %rcx
callq 0x78eb4
movl $0x518, %esi            # imm = 0x518
leaq (%rbx,%rsi), %rdi
addq 0x5b8(%rbx), %rsi
callq 0x7654a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7859b
movq %rax, %r15
movl $0x768, %esi            # imm = 0x768
movq %r12, %rdi
callq 0x55480
jmp 0x785b0
movq %rax, %r15
movq %r14, %rdi
callq 0x76616
movq %rbx, %rdi
callq 0x57640
movq %r15, %rdi
callq 0x57090