#include "SlideShow.h"
#include "SlideShowWindow.h"

static SlideShow *slideShow = nil;

@implementation SlideShow

-(id) init 
{
  if ( slideShow ) 
    {
      [self dealloc];
      return slideShow;
    }
  

  if ( ! ( self = [super init] ) ) 
    return nil;
  
  _window = [SlideShowWindow sharedSlideShowWindow];
  if ( _window ) 
    [_window setDelegate: self];
  else
    printf("could not init SlideShowWindow \n");

  NSLog(@"_window : %@",_window);

  slideShow = self;
  
  return slideShow;    
}
    
-(void) dealloc
{
#warning TODO
  [super dealloc];
}

+ (id) slideShow
{
  if ( ! slideShow ) 
    return [[self alloc] init];
  else
    return slideShow;
}

-(void) run
{
  NSLog(@"_window %@",_window);
  [_window orderFrontRegardless];
}


-(void) reveiveMouseEvent: (NSEvent *) event
{
  printf("Mouse Event\n"); 
}


-(void) receiveKeyEvent:(NSEvent*) event
{
  printf("Key Event\n"); 
}


@end


