// File: /workspace/github_c_makefile_star2_O1/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 0x821a4
movq (%r13), %rax
movq %r13, %rdi
callq *0x90(%rax)
xorl %ebx, %ebx
testb %al, %al
je 0x821a4
movq (%r13), %rax
movq %r13, %rdi
callq *0x40(%rax)
movq %rax, 0x20(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x48(%rax)
movq %rax, %r14
movq %rax, %r15
shrq $0x20, %r15
movq (%r13), %rax
movq %r13, %rdi
callq *0x50(%rax)
movq %rax, %r12
shrq $0x20, %rax
cmpl $0x3, %ebp
je 0x8202d
cmpl $0x2, %ebp
je 0x81ebe
testl %ebp, %ebp
jne 0x821a4
movq %rax, 0x18(%rsp)
movq (%r13), %rax
movq %r13, %rdi
callq *0x130(%rax)
leaq 0x28(%rsp), %rbp
movq %rax, (%rbp)
movq %rdx, 0x8(%rbp)
movq %r12, 0x10(%rsp)
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x55160
movl %r14d, (%rbp)
movl %r15d, 0x4(%rbp)
movq 0x10(%rsp), %rax
addl %r14d, %eax
movq %r12, %r14
movl %eax, 0x8(%rbp)
movq 0x18(%rsp), %rax
addl %r15d, %eax
movl %eax, 0xc(%rbp)
movq 0xeb120(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
leaq 0x8(%rsp), %r8
movq $0x0, (%r8)
movq 0xea7d3(%rip), %rdx     # 0x16c670
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x57930
movq 0x630(%r13), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
jmp 0x8219c
movq %rax, 0x18(%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 0x55160
movl %r14d, (%r13)
movl %r15d, 0x4(%r13)
leal (%r12,%r14), %eax
movl %eax, 0x8(%r13)
leal 0x2(%r15), %eax
movl %eax, 0xc(%r13)
movq 0xeb09c(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
movq 0xeb099(%rip), %rdx     # 0x16cfb8
leaq 0x28(%rsp), %r13
movq %rbp, %rdi
movq %r13, %rsi
movq %r8, %rbp
callq 0x57930
movl %r14d, (%r13)
movl %r15d, 0x4(%r13)
leal 0x2(%r14), %eax
movl %eax, 0x8(%r13)
movq %r12, 0x10(%rsp)
movq 0x18(%rsp), %rax
leal (%rax,%r15), %r12d
movl %r12d, 0xc(%r13)
movq 0xeb04d(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
movq %rax, (%rbp)
leaq 0x28(%rsp), %rbp
leaq 0x8(%rsp), %r8
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
movq 0xeb039(%rip), %rdx     # 0x16cfb8
callq 0x57930
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %r14d, %eax
movq 0x10(%rsp), %rdx
leal (%rax,%rdx), %ecx
movl %ecx, (%rbp)
movl %r15d, 0x4(%rbp)
leal 0x2(%rdx,%rax), %eax
movl %eax, 0x8(%rbp)
movl %r12d, 0xc(%rbp)
movl %r12d, %ebp
movq 0xeaff8(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %r8
movq %r13, %rdi
movq %r12, %rsi
movq 0xeafe5(%rip), %rdx     # 0x16cfb8
callq 0x57930
movq 0x18(%rsp), %rax
addl %r15d, %eax
addl $-0x2, %eax
movl %r14d, (%r12)
movl %eax, 0x4(%r12)
movq 0x10(%rsp), %rax
addl %r14d, %eax
movq %r13, %r14
movl %eax, 0x8(%r12)
movl %ebp, 0xc(%r12)
movq 0xeafa0(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %r8
movq %r13, %rdi
movq 0xeaf90(%rip), %rdx     # 0x16cfb8
jmp 0x82197
movq %rax, 0x18(%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 0x55160
movl %r14d, (%r13)
movl %r15d, 0x4(%r13)
leal (%r12,%r14), %eax
movl %eax, 0x8(%r13)
leal 0x2(%r15), %eax
movl %eax, 0xc(%r13)
movq 0xeaf2d(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
movq 0xea5e2(%rip), %rdx     # 0x16c670
leaq 0x28(%rsp), %r13
movq %rbp, %rdi
movq %r13, %rsi
movq %r8, %rbp
callq 0x57930
movl %r14d, (%r13)
movl %r15d, 0x4(%r13)
leal 0x2(%r14), %eax
movl %eax, 0x8(%r13)
movq %r12, 0x10(%rsp)
movq 0x18(%rsp), %rax
leal (%rax,%r15), %r12d
movl %r12d, 0xc(%r13)
movq 0xeaede(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
movq %rax, (%rbp)
leaq 0x28(%rsp), %rbp
leaq 0x8(%rsp), %r8
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
movq 0xea582(%rip), %rdx     # 0x16c670
callq 0x57930
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %r14d, %eax
movq 0x10(%rsp), %rdx
leal (%rax,%rdx), %ecx
movl %ecx, (%rbp)
movl %r15d, 0x4(%rbp)
leal 0x2(%rdx,%rax), %eax
movl %eax, 0x8(%rbp)
movl %r12d, 0xc(%rbp)
movl %r12d, %ebp
movq 0xeae89(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %r8
movq %r13, %rdi
movq %r12, %rsi
movq 0xea52e(%rip), %rdx     # 0x16c670
callq 0x57930
movq 0x18(%rsp), %rax
addl %r15d, %eax
addl $-0x2, %eax
movl %r14d, (%r12)
movl %eax, 0x4(%r12)
movq 0x10(%rsp), %rax
addl %r14d, %eax
movq %r13, %r14
movl %eax, 0x8(%r12)
movl %ebp, 0xc(%r12)
movq 0xeae31(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
xorl %eax, %eax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %r8
movq %r13, %rdi
movq 0xea4d9(%rip), %rdx     # 0x16c670
callq 0x57930
movq %r14, %rdi
callq 0x58780
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop