// File: /workspace/github_c_makefile_star2_O2/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 0x58bf0
leaq 0xb0088(%rip), %rax     # 0x15f560
movq %rax, (%rbx)
leaq 0x88(%rbx), %r14
movq %r14, %rdi
callq 0xaf998
andq $0x0, 0x80(%rbx)
testq %r15, %r15
je 0xaf777
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x56700
movq %rax, %r12
movq %rsp, %rdi
xorl %esi, %esi
callq 0x5a180
movq %rsp, %rsi
movq %r12, %rdi
callq 0x57c00
movq %r12, 0x80(%rbx)
movq %rsp, %rdi
callq 0x5a588
movq %r15, %rdi
callq 0x58fd0
leaq 0x53455(%rip), %rsi     # 0x102990
movq %rax, %rdi
callq 0x59180
testb %al, %al
je 0xaf550
movq 0xb27b2(%rip), %rax     # 0x161d00
jmp 0xaf572
movq %r15, %rdi
callq 0x58fd0
leaq 0x53436(%rip), %rsi     # 0x102995
movq %rax, %rdi
callq 0x59180
testb %al, %al
je 0xaf579
movq 0xb267e(%rip), %rax     # 0x161bf0
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x57130
cmpl %eax, %ebp
jge 0xaf76f
movq %r15, %rdi
movl %ebp, %esi
callq 0x590b0
movq %rax, %r13
andq $0x0, (%rsp)
movq %rax, %rdi
callq 0x58fd0
movq %rax, %rdi
leaq 0x533e2(%rip), %rsi     # 0x102991
callq 0x59180
testb %al, %al
jne 0xaf5ee
movq %r13, %rdi
callq 0x58fd0
movq %rax, %rdi
leaq 0x533c6(%rip), %rsi     # 0x102990
callq 0x59180
testb %al, %al
jne 0xaf5ee
movq %r13, %rdi
callq 0x58fd0
movq %rax, %rdi
leaq 0x533b0(%rip), %rsi     # 0x102995
callq 0x59180
testb %al, %al
je 0xaf63a
movl $0xe0, %edi
callq 0x56700
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xaf4b8
movq %r12, (%rsp)
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 %r14, %rdi
movq %rsp, %rsi
callq 0xaf9ae
incl %ebp
jmp 0xaf57b
movq %r13, %rdi
callq 0x58fd0
movq %rax, %rdi
leaq 0x5340b(%rip), %rsi     # 0x102a57
callq 0x59180
testb %al, %al
je 0xaf684
movl $0x88, %edi
callq 0x56700
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xaf9d8
movq %r12, (%rsp)
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
jmp 0xaf61b
movq %r13, %rdi
callq 0x58fd0
movq %rax, %rdi
leaq 0x53304(%rip), %rsi     # 0x10299a
callq 0x59180
testb %al, %al
je 0xaf6d1
movl $0x88, %edi
callq 0x56700
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xb0640
movq %r12, (%rsp)
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
jmp 0xaf61b
movq %r13, %rdi
callq 0x58fd0
movq %rax, %rdi
leaq 0x532bf(%rip), %rsi     # 0x1029a2
callq 0x59180
testb %al, %al
je 0xaf71e
movl $0x88, %edi
callq 0x56700
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xafc84
movq %r12, (%rsp)
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
jmp 0xaf61b
movq %r13, %rdi
callq 0x58fd0
movq %rax, %rdi
leaq 0x53278(%rip), %rsi     # 0x1029a8
callq 0x59180
testb %al, %al
je 0xaf633
movl $0x88, %edi
callq 0x56700
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xafba0
movq %r12, (%rsp)
movq 0x80(%rbx), %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
jmp 0xaf61b
movq %rbx, %rdi
callq 0xaf7e6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xaf7a8
jmp 0xaf7a8
jmp 0xaf7a8
movq %rax, %r15
movq %rsp, %rdi
callq 0x5a588
jmp 0xaf79c
movq %rax, %r15
movl $0x5b8, %esi            # imm = 0x5B8
jmp 0xaf7bc
movq %rax, %r15
jmp 0xaf7d5
movq %rax, %r15
movl $0x88, %esi
jmp 0xaf7bc
jmp 0xaf7ca
movq %rax, %r15
movl $0xe0, %esi
movq %r12, %rdi
callq 0x564c0
jmp 0xaf7cd
jmp 0xaf7ca
jmp 0xaf7ca
movq %rax, %r15
movq %r14, %rdi
callq 0x5c22c
movq %rbx, %rdi
callq 0x5a3a0
movq %r15, %rdi
callq 0x58260
nop