//
//  UserDefaults.m
//  Etokicho
//
//  Created by 二鏡 on 11/11/17.
//  Copyright 2011年 二鏡庵. All rights reserved.
//

#import "UserDefaults.h"

NSString *udKeepAspect = @"SceneViewKeepAspect";
NSString *udBackgroundAutoLock = @"SceneViewAutoLockBackground";
NSString *udDrawTextFrame = @"SceneViewDrawTextFrame";
NSString *udDropCentering = @"SceneViewDropCentering";

NSString *udDefaultFontName = @"LayerDefaultFontName";
NSString *udDefaultFontSize = @"LayerDefaultFontSize";

NSString *udSegmentGeneratorBaseWait = @"SegmentGeneratorBaseWait";
NSString *udSegmentGeneratorTextWait = @"SegmentGeneratorTextWait";
NSString *udSegmentGeneratorUseTextWait = @"SegmentGeneratorUseTextWait";

NSString *udSegmentGeneratorInsertTransition = @"SegmentGeneratorInsertTransition";
NSString *udSegmentGeneratorTransitionTime = @"SegmentGeneratorTransitionTime";

NSString *udUseLightPreview = @"UseLightPreview";
NSString *udStoryboardShowPopover = @"StoryboardShowPopover";
void
registerUserDefaults()
{
    id defs = [NSDictionary dictionaryWithObjectsAndKeys:
               // ECSceneView
               [NSNumber numberWithBool: YES], udKeepAspect,
               [NSNumber numberWithBool: YES], udBackgroundAutoLock,
               [NSNumber numberWithBool: YES], udDrawTextFrame,
               [NSNumber numberWithBool: YES], udDropCentering,
               // ECLayer
               @"HiraKakuProN-W3", udDefaultFontName,
               [NSNumber numberWithFloat: 28.0], udDefaultFontSize,
               
               // Segment Generator
               [NSNumber numberWithInteger: 1600],
               udSegmentGeneratorBaseWait,
               [NSNumber numberWithInteger: 50],
               udSegmentGeneratorTextWait,
               [NSNumber numberWithBool: YES],
               udSegmentGeneratorUseTextWait,
               
               // Transition
               [NSNumber numberWithBool: YES],
               udSegmentGeneratorInsertTransition,
               
               // story board
               [NSNumber numberWithBool: YES],
               udStoryboardShowPopover,
               
               // easy render
               [NSNumber numberWithBool: NO],
               udUseLightPreview,
               
               nil];
    
    
    id ud = [NSUserDefaults standardUserDefaults];
    [ud registerDefaults: defs];
}

