1// 2// SplashScreen.m 3// celestia 4// 5// Created by Da Woon Jung on 2005-12-18. 6// Copyright 2005 Chris Laurel. All rights reserved. 7// 8 9#import "SplashScreen.h" 10 11 12@implementation SplashImageView 13 14- (BOOL)mouseDownCanMoveWindow 15{ 16 return YES; 17} 18@end 19 20 21@implementation SplashWindow 22 23- (id)initWithContentRect:(NSRect)contentRect 24 styleMask:(unsigned int)aStyle 25 backing:(NSBackingStoreType)bufferingType 26 defer:(BOOL)flag 27{ 28 if (self = [super initWithContentRect: contentRect 29 styleMask: NSBorderlessWindowMask 30 backing: NSBackingStoreBuffered 31 defer:YES]) 32 { 33 [self setReleasedWhenClosed: YES]; 34 [self setBackgroundColor: [NSColor clearColor]]; 35 [self setAlphaValue: 1.0f]; 36 [self setOpaque: NO]; 37 [self setHasShadow: NO]; // image already has drop shadow 38 if ([self respondsToSelector: @selector(setMovableByWindowBackground:)]) 39 [self setMovableByWindowBackground: YES]; 40 41// [self center]; // does not center exactly so don't use 42 NSScreen *screen = [self screen]; 43 NSRect screenFrame = [screen frame]; 44 [self setFrameOrigin: 45 NSMakePoint((NSWidth(screenFrame) - NSWidth(contentRect))/2, 46 (NSHeight(screenFrame) - NSHeight(contentRect))/2)]; 47 } 48 49 return self; 50} 51@end 52