// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/xml/xul/box.cpp
// Function: smooth::XML::XUL::Box::Box(smooth::XML::Node*)
S::XML::XUL::Box::Box(Node *node) : Widget(node)
{
	layer = NIL;

	if (node != NIL)
	{
		layer = new GUI::Layer();

		if (node->GetName() == "hbox")		orient = HORIZONTAL;
		else if (node->GetName() == "vbox")	orient = VERTICAL;

		for (Int i = 0; i < node->GetNOfNodes(); i++)
		{
			Node		*nNode	= node->GetNthNode(i);
			XUL::Widget	*widget	= NIL;

			if (nNode->GetName() == "box" || nNode->GetName() == "hbox" || nNode->GetName() == "vbox")
			{
				widget = new XUL::Box(nNode);

				layer->Add(widget->GetWidget());

				widgets.Add(widget);
			}
			else if (nNode->GetName() == "button")
			{
				widget = new XUL::Button(nNode);

				layer->Add(widget->GetWidget());

				widgets.Add(widget);
			}
			else if (nNode->GetName() == "textbox")
			{
				widget = new XUL::TextBox(nNode);

				layer->Add(widget->GetWidget());

				widgets.Add(widget);
			}
			else if (nNode->GetName() == "label")
			{
				widget = new XUL::Label(nNode);

				layer->Add(widget->GetWidget());

				widgets.Add(widget);
			}
			else if (nNode->GetName() == "description")
			{
				widget = new XUL::Description(nNode);

				layer->Add(widget->GetWidget());

				widgets.Add(widget);
			}
		}

		CalculateChildMetrics();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x579a0
leaq 0xb4ec8(%rip), %rax     # 0x16a540
movq %rax, (%rbx)
leaq 0x88(%rbx), %r14
movq %r14, %rdi
callq 0x55d90
leaq 0xab14f(%rip), %rax     # 0x1607e0
movq %rax, 0xc8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
leaq 0xb4ed7(%rip), %rax     # 0x16a580
movq %rax, 0x88(%rbx)
movq $0x0, 0x80(%rbx)
testq %r15, %r15
je 0xb599b
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %r12
movq %rsp, %rdi
xorl %esi, %esi
callq 0x58e20
movq %rsp, %rsi
movq %r12, %rdi
callq 0x56a90
movq %r12, 0x80(%rbx)
movq %rsp, %rdi
callq 0x59200
movq %r15, %rdi
callq 0x57d50
leaq 0x5e1d7(%rip), %rsi     # 0x1138db
movq %rax, %rdi
callq 0x57ef0
testb %al, %al
je 0xb5719
movq 0xb75e9(%rip), %rax     # 0x16cd00
jmp 0xb573b
movq %r15, %rdi
callq 0x57d50
leaq 0x5e1b8(%rip), %rsi     # 0x1138e0
movq %rax, %rdi
callq 0x57ef0
testb %al, %al
je 0xb5742
movq 0xb74b5(%rip), %rax     # 0x16cbf0
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x56050
cmpl %eax, %ebp
jge 0xb5993
movq %r15, %rdi
movl %ebp, %esi
callq 0x57e20
movq %rax, %r13
movq %rax, %rdi
callq 0x57d50
movq %rax, %rdi
leaq 0x5e169(%rip), %rsi     # 0x1138dc
callq 0x57ef0
testb %al, %al
jne 0xb57b2
movq %r13, %rdi
callq 0x57d50
movq %rax, %rdi
leaq 0x5e14d(%rip), %rsi     # 0x1138db
callq 0x57ef0
testb %al, %al
jne 0xb57b2
movq %r13, %rdi
callq 0x57d50
movq %rax, %rdi
leaq 0x5e137(%rip), %rsi     # 0x1138e0
callq 0x57ef0
testb %al, %al
je 0xb57fe
movl $0xe0, %edi
callq 0x556b0
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xb5658
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movq (%r13), %rcx
movq %r13, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movq %r12, (%rsp)
movq %r14, %rdi
movq %rsp, %rsi
callq 0x5af08
incl %ebp
jmp 0xb5744
movq %r13, %rdi
callq 0x57d50
movq %rax, %rdi
leaq 0x5e192(%rip), %rsi     # 0x1139a2
callq 0x57ef0
testb %al, %al
je 0xb5860
movl $0x88, %edi
callq 0x556b0
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xb5be0
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movq (%r13), %rcx
movq %r13, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movq %r12, (%rsp)
movq %r14, %rdi
movq %rsp, %rsi
callq 0x5af08
jmp 0xb57f7
movq %r13, %rdi
callq 0x57d50
movq %rax, %rdi
leaq 0x5e073(%rip), %rsi     # 0x1138e5
callq 0x57ef0
testb %al, %al
je 0xb58c5
movl $0x88, %edi
callq 0x556b0
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xb68d8
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movq (%r13), %rcx
movq %r13, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movq %r12, (%rsp)
movq %r14, %rdi
movq %rsp, %rsi
callq 0x5af08
jmp 0xb57f7
movq %r13, %rdi
callq 0x57d50
movq %rax, %rdi
leaq 0x5e016(%rip), %rsi     # 0x1138ed
callq 0x57ef0
testb %al, %al
je 0xb592a
movl $0x88, %edi
callq 0x556b0
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xb5e94
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movq (%r13), %rcx
movq %r13, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movq %r12, (%rsp)
movq %r14, %rdi
movq %rsp, %rsi
callq 0x5af08
jmp 0xb57f7
movq %r13, %rdi
callq 0x57d50
movq %rax, %rdi
leaq 0x5dfb7(%rip), %rsi     # 0x1138f3
callq 0x57ef0
testb %al, %al
je 0xb57f7
movl $0x88, %edi
callq 0x556b0
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xb5dac
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movq (%r13), %rcx
movq %r13, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movq %r12, (%rsp)
movq %r14, %rdi
movq %rsp, %rsi
callq 0x5af08
jmp 0xb57f7
movq %rbx, %rdi
callq 0xb5a0a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb59cc
jmp 0xb59cc
jmp 0xb59cc
movq %rax, %r15
movq %rsp, %rdi
callq 0x59200
jmp 0xb59c0
movq %rax, %r15
movl $0x5b8, %esi            # imm = 0x5B8
jmp 0xb59e0
movq %rax, %r15
jmp 0xb59f9
movq %rax, %r15
movl $0x88, %esi
jmp 0xb59e0
jmp 0xb59ee
movq %rax, %r15
movl $0xe0, %esi
movq %r12, %rdi
callq 0x55480
jmp 0xb59f1
jmp 0xb59ee
jmp 0xb59ee
movq %rax, %r15
movq %r14, %rdi
callq 0x5b11e
movq %rbx, %rdi
callq 0x59020
movq %r15, %rdi
callq 0x57090
nop