// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/gui/widgets/multi/image/imageentry.cpp
// Function: smooth::GUI::ImageEntry::Paint(int)
S::Int S::GUI::ImageEntry::Paint(Int message)
{
	if (!IsRegistered()) return Error();
	if (!IsVisible())    return Success();

	Surface	*surface  = GetDrawSurface();
	Point	 realPos  = GetRealPosition();
	Size	 realSize = GetRealSize();

	switch (message)
	{
		case SP_PAINT:
			surface->StartPaint(GetVisibleArea());

			surface->Box(Rect(realPos, realSize), Setup::ClientColor, Rect::Filled);
			image->Paint(SP_PAINT);

			surface->EndPaint();

			break;
		case SP_MOUSEIN:
			surface->StartPaint(GetVisibleArea());

			surface->Box(Rect(realPos,				Size(realSize.cx, 2)), Setup::GradientStartColor, Rect::Filled);
			surface->Box(Rect(realPos,				Size(2, realSize.cy)), Setup::GradientStartColor, Rect::Filled);
			surface->Box(Rect(realPos + Point(realSize.cx - 2, 0),	Size(2, realSize.cy)), Setup::GradientStartColor, Rect::Filled);
			surface->Box(Rect(realPos + Point(0, realSize.cy - 2),	Size(realSize.cx, 2)), Setup::GradientStartColor, Rect::Filled);

			surface->EndPaint();

			break;
		case SP_MOUSEOUT:
			surface->StartPaint(GetVisibleArea());

			surface->Box(Rect(realPos,				Size(realSize.cx, 2)), Setup::ClientColor, Rect::Filled);
			surface->Box(Rect(realPos,				Size(2, realSize.cy)), Setup::ClientColor, Rect::Filled);
			surface->Box(Rect(realPos + Point(realSize.cx - 2, 0),	Size(2, realSize.cy)), Setup::ClientColor, Rect::Filled);
			surface->Box(Rect(realPos + Point(0, realSize.cy - 2),	Size(realSize.cx, 2)), Setup::ClientColor, Rect::Filled);

			surface->EndPaint();

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
movq %rdi, %r13
movq (%rdi), %rax
callq *0x88(%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0x81cdc
movq (%r13), %rax
movq %r13, %rdi
callq *0x90(%rax)
xorl %ebx, %ebx
testb %al, %al
je 0x81cdc
movq (%r13), %rax
movq %r13, %rdi
callq *0x40(%rax)
movq %rax, 0x10(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x48(%rax)
movq %rax, %r12
movq %rax, %r15
shrq $0x20, %r15
movq (%r13), %rax
movq %r13, %rdi
callq *0x50(%rax)
movq %rax, %r14
shrq $0x20, %r14
cmpl $0x3, %ebp
je 0x81b68
cmpl $0x2, %ebp
je 0x819fc
testl %ebp, %ebp
jne 0x81cdc
movq %rax, 0x20(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x130(%rax)
leaq 0x28(%rsp), %rbp
movq %rax, (%rbp)
movq %rdx, 0x8(%rbp)
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x55160
movl %r12d, (%rbp)
movl %r15d, 0x4(%rbp)
movq 0x20(%rsp), %rax
addl %r12d, %eax
movq 0x10(%rsp), %r12
movl %eax, 0x8(%rbp)
addl %r15d, %r14d
movl %r14d, 0xc(%rbp)
movq 0xea5e2(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
leaq 0x4(%rsp), %r8
movq $0x0, (%r8)
movq 0xe9c95(%rip), %rdx     # 0x16b670
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x57930
movq 0x630(%r13), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
jmp 0x81cd4
movq %rax, %rbp
movq %rax, 0x20(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x130(%rax)
leaq 0x28(%rsp), %r13
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x55160
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
leal (%r12,%rbp), %eax
movl %eax, 0x1c(%rsp)
movl %eax, 0x8(%r13)
leal 0x2(%r15), %eax
movl %eax, 0xc(%r13)
movq 0xea55a(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x4(%rsp), %r8
movq %rax, (%r8)
movq 0xea557(%rip), %rdx     # 0x16bfb8
leaq 0x28(%rsp), %r13
movq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x57930
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
leal 0x2(%r12), %eax
movl %eax, 0x8(%r13)
leal (%r14,%r15), %eax
movl %eax, 0xc(%rsp)
movl %eax, 0xc(%r13)
movq 0xea50e(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x4(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %r13
leaq 0x4(%rsp), %r8
movq %rbp, %rdi
movq %r13, %rsi
movq 0xea4fb(%rip), %rdx     # 0x16bfb8
movq %r8, %rbp
callq 0x57930
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %r12d, %eax
movq 0x20(%rsp), %rdx
leal (%rax,%rdx), %ecx
movl %ecx, (%r13)
movl %r15d, 0x4(%r13)
leal 0x2(%rdx,%rax), %eax
movl %eax, 0x8(%r13)
movl 0xc(%rsp), %eax
movl %eax, 0xc(%r13)
movq 0xea4b4(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
movq %rax, (%rbp)
leaq 0x28(%rsp), %rbp
leaq 0x4(%rsp), %r8
movq 0x10(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
movq 0xea4a0(%rip), %rdx     # 0x16bfb8
callq 0x57930
leal (%r14,%r15), %eax
addl $-0x2, %eax
movl %r12d, (%rbp)
movq %r13, %r12
movl %eax, 0x4(%rbp)
movl 0x1c(%rsp), %eax
movl %eax, 0x8(%rbp)
movl 0xc(%rsp), %eax
movl %eax, 0xc(%rbp)
movq 0xea465(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x4(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %rsi
leaq 0x4(%rsp), %r8
movq %r13, %rdi
movq 0xea455(%rip), %rdx     # 0x16bfb8
jmp 0x81ccf
movq %rax, %rbp
movq %rax, 0x20(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x130(%rax)
leaq 0x28(%rsp), %r13
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x55160
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
leal (%r12,%rbp), %eax
movl %eax, 0x1c(%rsp)
movl %eax, 0x8(%r13)
leal 0x2(%r15), %eax
movl %eax, 0xc(%r13)
movq 0xea3ee(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x4(%rsp), %r8
movq %rax, (%r8)
movq 0xe9aa3(%rip), %rdx     # 0x16b670
leaq 0x28(%rsp), %r13
movq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x57930
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
leal 0x2(%r12), %eax
movl %eax, 0x8(%r13)
leal (%r14,%r15), %eax
movl %eax, 0xc(%rsp)
movl %eax, 0xc(%r13)
movq 0xea3a2(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x4(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %r13
leaq 0x4(%rsp), %r8
movq %rbp, %rdi
movq %r13, %rsi
movq 0xe9a47(%rip), %rdx     # 0x16b670
movq %r8, %rbp
callq 0x57930
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %r12d, %eax
movq 0x20(%rsp), %rdx
leal (%rax,%rdx), %ecx
movl %ecx, (%r13)
movl %r15d, 0x4(%r13)
leal 0x2(%rdx,%rax), %eax
movl %eax, 0x8(%r13)
movl 0xc(%rsp), %eax
movl %eax, 0xc(%r13)
movq 0xea348(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
movq %rax, (%rbp)
leaq 0x28(%rsp), %rbp
leaq 0x4(%rsp), %r8
movq 0x10(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
movq 0xe99ec(%rip), %rdx     # 0x16b670
callq 0x57930
leal (%r14,%r15), %eax
addl $-0x2, %eax
movl %r12d, (%rbp)
movq %r13, %r12
movl %eax, 0x4(%rbp)
movl 0x1c(%rsp), %eax
movl %eax, 0x8(%rbp)
movl 0xc(%rsp), %eax
movl %eax, 0xc(%rbp)
movq 0xea2f9(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x4(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %rsi
leaq 0x4(%rsp), %r8
movq %r13, %rdi
movq 0xe99a1(%rip), %rdx     # 0x16b670
callq 0x57930
movq %r12, %rdi
callq 0x58780
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop