// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/gui/window/window.cpp
// Function: smooth::GUI::Window::Window(smooth::String const&, smooth::GUI::Point const&, smooth::GUI::Size const&, void*)
S::GUI::Window::Window(const String &title, const Point &iPos, const Size &iSize, Void *iWindow) : Widget(iPos, iSize)
{
	backend = WindowBackend::CreateBackendInstance();
	backend->onEvent.SetParentObject(this);
	backend->onEvent.Connect(&Window::Process, this);

	backend->onCreate.Connect(&Window::OnCreate, this);
	backend->onDestroy.Connect(&Window::OnDestroy, this);

	backend->onMinimize.Connect(&Window::OnMinimize, this);
	backend->onMaximize.Connect(&Window::OnMaximize, this);

	backend->onRestore.Connect(&Window::OnRestore, this);

	backend->doClose.Connect(&doClose);

	windows.Add(this, GetHandle());

	maximized	= False;
	minimized	= False;

	type		= classID;

	order		= 0;

	layoutDirection = LD_DEFAULT;

	if (title != NIL) text = title;
	else		  text = "smooth Application";

#ifdef __WIN32__
	frameWidth	= GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
#else
	frameWidth	= 1;

	backend->SetSizeModifier(Size(-6, -6));
#endif

	updateRect	= Rect(Point(-1, -1), Size(0, 0));

	icon		= NIL;

	created		= False;
	visible		= False;
	destroyed	= False;

	visibilitySet	= False;

	mainLayer	= new Layer();

	Add(mainLayer);

	doClose.Connect(True);

	onCreate.SetParentObject(this);
	onPaint.SetParentObject(this);
	onEvent.SetParentObject(this);

	handleSystemMessage.Connect(MessageUnknown);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbp
movq %rdi, %rbx
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x57a30
movq 0xd40ee(%rip), %rax     # 0x16b748
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x5d0(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x58950
pxor %xmm0, %xmm0
movdqu %xmm0, 0x5d8(%rbx)
movdqu %xmm0, 0x5ec(%rbx)
leaq 0x600(%rbx), %rdi
movq %rdi, 0x18(%rsp)
xorl %esi, %esi
callq 0x58e20
xorl %eax, %eax
movq %rax, 0x630(%rbx)
leaq 0xca09f(%rip), %rcx     # 0x161748
movq %rcx, 0x628(%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x638(%rbx)
movq %rax, 0x650(%rbx)
movq %rcx, 0x648(%rbx)
movdqu %xmm0, 0x658(%rbx)
movq %rax, 0x670(%rbx)
leaq 0xd07d0(%rip), %rcx     # 0x167eb0
movq %rcx, 0x668(%rbx)
movdqu %xmm0, 0x678(%rbx)
leaq 0x688(%rbx), %r12
movdqu %xmm0, 0x690(%rbx)
movq %rax, 0x6a0(%rbx)
leaq 0xd0674(%rip), %rcx     # 0x167d80
movq %rcx, 0x688(%rbx)
leaq 0x6b0(%rbx), %r13
movdqu %xmm0, 0x6b8(%rbx)
movq %rax, 0x6c8(%rbx)
leaq 0xd06c0(%rip), %rax     # 0x167df0
movq %rax, 0x6b0(%rbx)
callq 0x9a1b6
movq %rax, %r15
movq %r15, 0x5c0(%rbx)
addq $0x58, %r15
movq %rbx, 0x60(%rax)
movq %r15, %rdi
callq 0x999a0
movl $0x81, %esi
movq %r15, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x99b58
movl $0xe0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x171, %esi            # imm = 0x171
xorl %edx, %edx
movq %rbx, %rcx
callq 0x996c0
movl $0x100, %edi            # imm = 0x100
addq 0x5c0(%rbx), %rdi
movl $0x179, %esi            # imm = 0x179
xorl %edx, %edx
movq %rbx, %rcx
callq 0x996c0
movq 0x5c0(%rbx), %rdi
subq $-0x80, %rdi
movl $0x181, %esi            # imm = 0x181
xorl %edx, %edx
movq %rbx, %rcx
callq 0x996c0
movl $0xa0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x189, %esi            # imm = 0x189
xorl %edx, %edx
movq %rbx, %rcx
callq 0x996c0
movl $0xc0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x191, %esi            # imm = 0x191
xorl %edx, %edx
movq %rbx, %rcx
callq 0x996c0
movq 0x5c0(%rbx), %r15
addq $0x30, %r15
cmpq %r15, %r12
je 0x97811
movq %r15, %rdi
callq 0x6b38c
movq %r15, %rdi
movq %r12, %rsi
callq 0x99d1c
movl 0x8(%rbx), %edx
leaq 0x20(%rsp), %rsi
movq %rbx, (%rsi)
movq 0xd3e8d(%rip), %rdi     # 0x16b6b0
callq 0x5af42
movw $0x0, 0x5c8(%rbx)
movq 0xd3ff0(%rip), %rax     # 0x16b828
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
xorl %eax, %eax
movl %eax, 0x5b8(%rbx)
movl %eax, 0x618(%rbx)
movq %rbp, %rdi
xorl %esi, %esi
callq 0x56bd0
leaq 0xf0(%rbx), %rdi
testb %al, %al
je 0x9786c
movq %rbp, %rsi
callq 0x555f0
jmp 0x97878
leaq 0x5be4d(%rip), %rsi     # 0xf36c0
callq 0x55f40
movl $0x1, 0x5e8(%rbx)
movq 0x5c0(%rbx), %rdi
movabsq $-0x500000006, %rax     # imm = 0xFFFFFFFAFFFFFFFA
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
callq 0x9a4f4
leaq 0x5ec(%rbx), %rax
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
movq %r14, %rdi
xorl %esi, %esi
callq 0x56740
xorl %eax, %eax
movb %al, 0x5ca(%rbx)
movb %al, 0xcb(%rbx)
movb %al, 0x5cb(%rbx)
movb %al, 0x5cc(%rbx)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %rbp
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0x56a90
movq %rbp, 0x620(%rbx)
leaq 0x20(%rsp), %rdi
callq 0x59200
movq 0x620(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq %r12, %rdi
callq 0x6b38c
movq %r12, %rdi
movl $0x1, %esi
callq 0x99ecc
movq %rbx, 0x630(%rbx)
movq %rbx, 0x650(%rbx)
movq %rbx, 0x670(%rbx)
movq %r13, %rdi
callq 0x999a0
movq %r13, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x99fa8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x59200
jmp 0x9797e
movq %rax, 0x8(%rsp)
movl $0x5b8, %esi            # imm = 0x5B8
movq %rbp, %rdi
callq 0x55480
jmp 0x979a4
jmp 0x9799f
jmp 0x9799f
movq %rax, 0x8(%rsp)
jmp 0x979f2
movq %rax, 0x8(%rsp)
jmp 0x979fa
movq %rax, 0x8(%rsp)
leaq 0x628(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x648(%rbx), %rbp
leaq 0x668(%rbx), %r15
movq %r13, %rdi
callq 0x99780
movq %r12, %rdi
callq 0x9979a
movq %r15, %rdi
callq 0x997b4
movq %rbp, %rdi
callq 0x700f4
movq 0x10(%rsp), %rdi
callq 0x700f4
movq 0x18(%rsp), %rdi
callq 0x59200
movq %r14, %rdi
callq 0x59148
movq %rbx, %rdi
callq 0x57640
movq 0x8(%rsp), %rdi
callq 0x57090