// File: /workspace/github_c_makefile_star2_O2/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)
testb %al, %al
je 0x7fa4c
movq (%r13), %rax
movq %r13, %rdi
callq *0x90(%rax)
xorl %ebx, %ebx
testb %al, %al
je 0x7fd2a
movq (%r13), %rax
movq %r13, %rdi
callq *0x40(%rax)
movq %rax, 0x20(%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 0x7fbbb
cmpl $0x2, %ebp
je 0x7fa54
testl %ebp, %ebp
jne 0x7fd2a
movq %rax, 0x10(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x130(%rax)
leaq 0x28(%rsp), %rbp
movq %rax, (%rbp)
movq %rdx, 0x8(%rbp)
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x56160
movl %r12d, (%rbp)
movl %r15d, 0x4(%rbp)
movq 0x10(%rsp), %rax
addl %r12d, %eax
movq 0x20(%rsp), %r12
movl %eax, 0x8(%rbp)
addl %r15d, %r14d
movl %r14d, 0xc(%rbp)
movq 0xe258f(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x4(%rsp), %r8
andq $0x0, (%r8)
movq 0xe1c45(%rip), %rdx     # 0x161670
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x58b80
movq 0x630(%r13), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
jmp 0x7fd22
pushq $-0x1
popq %rbx
jmp 0x7fd2a
movq %rax, 0x10(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x130(%rax)
leaq 0x28(%rsp), %r13
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x56160
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
movq 0x10(%rsp), %rax
addl %r12d, %eax
movl %eax, 0x1c(%rsp)
movl %eax, 0x8(%r13)
leal 0x2(%r15), %eax
movl %eax, 0xc(%r13)
movq 0xe24fe(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x4(%rsp), %r8
andq $0x0, (%r8)
movq 0xe24fc(%rip), %rdx     # 0x161fb8
leaq 0x28(%rsp), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x58b80
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 0xe24b8(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x4(%rsp), %rax
andq $0x0, (%rax)
leaq 0x28(%rsp), %r13
leaq 0x4(%rsp), %r8
movq %rbp, %rdi
movq %r13, %rsi
movq 0xe24a6(%rip), %rdx     # 0x161fb8
movq %r8, %rbp
callq 0x58b80
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %r12d, %eax
movq 0x10(%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 0xe245f(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
andq $0x0, (%rbp)
leaq 0x28(%rsp), %rbp
leaq 0x4(%rsp), %r8
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
movq 0xe244c(%rip), %rdx     # 0x161fb8
callq 0x58b80
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 0xe2411(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x4(%rsp), %rax
andq $0x0, (%rax)
leaq 0x28(%rsp), %rsi
leaq 0x4(%rsp), %r8
movq %r13, %rdi
movq 0xe2402(%rip), %rdx     # 0x161fb8
jmp 0x7fd1d
movq %rax, 0x10(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x130(%rax)
leaq 0x28(%rsp), %r13
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x56160
movl %r12d, (%r13)
movl %r15d, 0x4(%r13)
movq 0x10(%rsp), %rax
addl %r12d, %eax
movl %eax, 0x1c(%rsp)
movl %eax, 0x8(%r13)
leal 0x2(%r15), %eax
movl %eax, 0xc(%r13)
movq 0xe2397(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x4(%rsp), %r8
andq $0x0, (%r8)
movq 0xe1a4d(%rip), %rdx     # 0x161670
leaq 0x28(%rsp), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x58b80
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 0xe2351(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x4(%rsp), %rax
andq $0x0, (%rax)
leaq 0x28(%rsp), %r13
leaq 0x4(%rsp), %r8
movq %rbp, %rdi
movq %r13, %rsi
movq 0xe19f7(%rip), %rdx     # 0x161670
movq %r8, %rbp
callq 0x58b80
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %r12d, %eax
movq 0x10(%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 0xe22f8(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
andq $0x0, (%rbp)
leaq 0x28(%rsp), %rbp
leaq 0x4(%rsp), %r8
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
movq 0xe199d(%rip), %rdx     # 0x161670
callq 0x58b80
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 0xe22aa(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x4(%rsp), %rax
andq $0x0, (%rax)
leaq 0x28(%rsp), %rsi
leaq 0x4(%rsp), %r8
movq %r13, %rdi
movq 0xe1953(%rip), %rdx     # 0x161670
callq 0x58b80
movq %r12, %rdi
callq 0x59a80
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop