// File: /workspace/github_c_makefile_star2_O1/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 0xd49b6(%rip), %rax     # 0x16c748
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 0xca967(%rip), %rcx     # 0x162748
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 0xd1098(%rip), %rcx     # 0x168eb0
movq %rcx, 0x668(%rbx)
movdqu %xmm0, 0x678(%rbx)
leaq 0x688(%rbx), %r12
movdqu %xmm0, 0x690(%rbx)
movq %rax, 0x6a0(%rbx)
leaq 0xd0f3c(%rip), %rcx     # 0x168d80
movq %rcx, 0x688(%rbx)
leaq 0x6b0(%rbx), %r13
movdqu %xmm0, 0x6b8(%rbx)
movq %rax, 0x6c8(%rbx)
leaq 0xd0f88(%rip), %rax     # 0x168df0
movq %rax, 0x6b0(%rbx)
callq 0x9a992
movq %rax, %r15
movq %r15, 0x5c0(%rbx)
addq $0x58, %r15
movq %rbx, 0x60(%rax)
movq %r15, %rdi
callq 0x9a180
movl $0x81, %esi
movq %r15, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x9a34a
movl $0xe0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x171, %esi            # imm = 0x171
xorl %edx, %edx
movq %rbx, %rcx
callq 0x99eb0
movl $0x100, %edi            # imm = 0x100
addq 0x5c0(%rbx), %rdi
movl $0x179, %esi            # imm = 0x179
xorl %edx, %edx
movq %rbx, %rcx
callq 0x99eb0
movq 0x5c0(%rbx), %rdi
subq $-0x80, %rdi
movl $0x181, %esi            # imm = 0x181
xorl %edx, %edx
movq %rbx, %rcx
callq 0x99eb0
movl $0xa0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x189, %esi            # imm = 0x189
xorl %edx, %edx
movq %rbx, %rcx
callq 0x99eb0
movl $0xc0, %edi
addq 0x5c0(%rbx), %rdi
movl $0x191, %esi            # imm = 0x191
xorl %edx, %edx
movq %rbx, %rcx
callq 0x99eb0
movq 0x5c0(%rbx), %r15
addq $0x30, %r15
cmpq %r15, %r12
je 0x97f49
movq %r15, %rdi
callq 0x6b418
movq %r15, %rdi
movq %r12, %rsi
callq 0x9a50c
movl 0x8(%rbx), %edx
leaq 0x20(%rsp), %rsi
movq %rbx, (%rsi)
movq 0xd4755(%rip), %rdi     # 0x16c6b0
callq 0x5af72
movw $0x0, 0x5c8(%rbx)
movq 0xd48b8(%rip), %rax     # 0x16c828
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 0x97fa4
movq %rbp, %rsi
callq 0x555f0
jmp 0x97fb0
leaq 0x5c6b3(%rip), %rsi     # 0xf465e
callq 0x55f40
movl $0x1, 0x5e8(%rbx)
movq 0x5c0(%rbx), %rdi
movabsq $-0x500000006, %rax     # imm = 0xFFFFFFFAFFFFFFFA
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
callq 0x9ace6
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 0x6b418
movq %r12, %rdi
movl $0x1, %esi
callq 0x9a6b4
movq %rbx, 0x630(%rbx)
movq %rbx, 0x650(%rbx)
movq %rbx, 0x670(%rbx)
movq %r13, %rdi
callq 0x9a180
movq %r13, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x9a78e
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 0x980b6
movq %rax, 0x8(%rsp)
movl $0x5b8, %esi            # imm = 0x5B8
movq %rbp, %rdi
callq 0x55480
jmp 0x980dc
jmp 0x980d7
jmp 0x980d7
movq %rax, 0x8(%rsp)
jmp 0x9812a
movq %rax, 0x8(%rsp)
jmp 0x98132
movq %rax, 0x8(%rsp)
leaq 0x628(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x648(%rbx), %rbp
leaq 0x668(%rbx), %r15
movq %r13, %rdi
callq 0x99f6e
movq %r12, %rdi
callq 0x99f88
movq %r15, %rdi
callq 0x99fa2
movq %rbp, %rdi
callq 0x703d2
movq 0x10(%rsp), %rdi
callq 0x703d2
movq 0x18(%rsp), %rdi
callq 0x59200
movq %r14, %rdi
callq 0x59148
movq %rbx, %rdi
callq 0x57640
movq 0x8(%rsp), %rdi
callq 0x57090