//
//  EmojiView.m
//  Afficheur
//
//  Created by kichi on 09/02/16.
//  Copyright 2009 Katsuhiko Ichinose. All rights reserved.
//

#import "EmojiView.h"


@implementation EmojiView

- (id)initWithFrame:(NSRect)frameRect
			unicode:(unichar)unicode
{
	self = [super initWithFrame:frameRect];
	if (self)
	{
		_unicode = unicode;
		[self setImageFrameStyle:NSImageFrameNone];
		NSImage *image = [NSImage imageNamed:[NSString stringWithFormat:@"emoji%04X", unicode]];
		//NSImage *cellImage = [[[NSImage alloc] initWithSize:NSMakeSize(frameRect.size.width, frameRect.size.height)] autorelease];
		//NSSize cellSize = [cellImage size];
		//NSSize imageSize = [image size];
		//[cellImage lockFocus];
		//[image drawInRect:NSMakeRect(0, 0, cellSize.width, cellSize.height)
		//		 fromRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)
		//		operation:NSCompositeCopy
		//		 fraction:1.0];
		//[cellImage unlockFocus];
		[self setImage:image];
		[self setAnimates:NO];
	}
	return self;
}

- (unichar)unicode
{
	return _unicode;
}


@end
