// File: /workspace/github_c_makefile_star2_O2/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 0x58c80
movq 0xcdcee(%rip), %rax     # 0x161748
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x5d0(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x59c80
pxor %xmm0, %xmm0
movdqu %xmm0, 0x5d8(%rbx)
movdqu %xmm0, 0x5ec(%rbx)
leaq 0x600(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x5a180
andq $0x0, 0x630(%rbx)
leaq 0xc3cc2(%rip), %rax     # 0x157768
movq %rax, 0x628(%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x638(%rbx)
andq $0x0, 0x650(%rbx)
movq %rax, 0x648(%rbx)
movdqu %xmm0, 0x658(%rbx)
andq $0x0, 0x670(%rbx)
leaq 0xca3f1(%rip), %rax     # 0x15ded0
movq %rax, 0x668(%rbx)
movdqu %xmm0, 0x678(%rbx)
leaq 0x688(%rbx), %r12
movdqu %xmm0, 0x690(%rbx)
andq $0x0, 0x6a0(%rbx)
leaq 0xca294(%rip), %rax     # 0x15dda0
movq %rax, 0x688(%rbx)
andq $0x0, 0x6c8(%rbx)
leaq 0x6b0(%rbx), %r13
movdqu %xmm0, 0x6b8(%rbx)
leaq 0xca2df(%rip), %rax     # 0x15de10
movq %rax, 0x6b0(%rbx)
callq 0x962a8
movq %rax, 0x5c0(%rbx)
movq %rax, %rdi
addq $0x58, %rdi
movq %rbx, 0x60(%rax)
movl $0x81, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x958f2
movl $0xe0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x171, %esi            # imm = 0x171
xorl %edx, %edx
movq %rbx, %rcx
callq 0x95928
movl $0x100, %edi            # imm = 0x100
addq 0x5c0(%rbx), %rdi
movl $0x179, %esi            # imm = 0x179
xorl %edx, %edx
movq %rbx, %rcx
callq 0x95928
movq 0x5c0(%rbx), %rdi
subq $-0x80, %rdi
movl $0x181, %esi            # imm = 0x181
xorl %edx, %edx
movq %rbx, %rcx
callq 0x95928
movl $0xa0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x189, %esi            # imm = 0x189
xorl %edx, %edx
movq %rbx, %rcx
callq 0x95928
movl $0xc0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x191, %esi            # imm = 0x191
xorl %edx, %edx
movq %rbx, %rcx
callq 0x95928
movq 0x5c0(%rbx), %rdi
addq $0x30, %rdi
movq %r12, %rsi
callq 0x959c4
leaq 0x20(%rsp), %rsi
movq %rbx, (%rsi)
movl 0x8(%rbx), %edx
movq 0xcdaa7(%rip), %rdi     # 0x1616b0
callq 0x959ee
andw $0x0, 0x5c8(%rbx)
movq 0xcdc0b(%rip), %rax     # 0x161828
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
andl $0x0, 0x5b8(%rbx)
andl $0x0, 0x618(%rbx)
movq %rbp, %rdi
xorl %esi, %esi
callq 0x57d40
leaq 0xf0(%rbx), %rdi
testb %al, %al
je 0x93c51
movq %rbp, %rsi
callq 0x56630
jmp 0x93c5d
leaq 0x4fa26(%rip), %rsi     # 0xe367e
callq 0x57010
movl $0x1, 0x5e8(%rbx)
movq 0x5c0(%rbx), %rdi
movabsq $-0x500000006, %rax     # imm = 0xFFFFFFFAFFFFFFFA
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
callq 0x9655e
leaq 0x5ec(%rbx), %rax
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
movq %r14, %rdi
xorl %esi, %esi
callq 0x57880
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 0x56700
movq %rax, %rbp
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x5a180
leaq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0x57c00
movq %rbp, 0x620(%rbx)
leaq 0x20(%rsp), %rdi
callq 0x5a588
movq 0x620(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x95a00
movq %rbx, 0x630(%rbx)
movq %rbx, 0x650(%rbx)
movq %rbx, 0x670(%rbx)
pushq $-0x2
popq %rsi
movq %r13, %rdi
callq 0x95a20
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 0x5a588
jmp 0x93d4f
movq %rax, 0x8(%rsp)
movl $0x5b8, %esi            # imm = 0x5B8
movq %rbp, %rdi
callq 0x564c0
jmp 0x93d75
jmp 0x93d70
jmp 0x93d70
movq %rax, 0x8(%rsp)
jmp 0x93dc8
movq %rax, 0x8(%rsp)
jmp 0x93dd0
movq %rax, 0x8(%rsp)
leaq 0x628(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x648(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x668(%rbx), %rbp
movq %r13, %rdi
callq 0x95a40
movq %r12, %rdi
callq 0x95a5a
movq %rbp, %rdi
callq 0x95a74
movq 0x10(%rsp), %rdi
callq 0x700e0
movq 0x18(%rsp), %rdi
callq 0x700e0
movq %r15, %rdi
callq 0x5a588
movq %r14, %rdi
callq 0x5a4c8
movq %rbx, %rdi
callq 0x58860
movq 0x8(%rsp), %rdi
callq 0x58260