Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created September 15, 2008 00:04
Show Gist options
  • Save erichocean/10782 to your computer and use it in GitHub Desktop.
Save erichocean/10782 to your computer and use it in GitHub Desktop.
//
// MainWindow.objc
// PhotoBooth
//
// Created by Erich Ocean on 9/8/08.
// Copyright 2008 Erich Atlas Ocean. All rights reserved.
//
sc_require( "PhotoBooth" );
@synchronized( PB ) {
PB.mainWindow = [SCWindow window: [_DICT:
@"titleBinding", @"PB.windowTitle",
@"nowShowingBinding", @"PB.page",
@"startupPage", [SCPage page: [_DICT:
@"outlets", [_ARRAY: @"body", nil],
@"body", [SCImageView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 1920.0 ),
@"imageBinding", @"PB.startupImage",
nil]],
nil]],
@"attractPage", [SCPage page: [_DICT:
@"outlets", [_ARRAY: @"body", nil],
@"body", [SCQuickTimeView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 1920.0 ),
@"movieBinding", @"PB.attractLoop",
nil]],
nil]],
@"errorPage", [SCPage page: [_DICT:
@"outlets", [_ARRAY: @"body", nil],
@"body", [PBErrorView view: [_DICT:
@"frame", _RECT( 100.0, 100.0, 880.0, 1000.0 ),
@"messageBinding", @"PB.errorMessage",
nil]],
nil]],
@"mainPage", [SCPage page: [_DICT:
@"outlets", [_ARRAY: @"body", nil],
@"body", [PBMainView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 1920.0 ),
@"outlets", [_ARRAY: @"newButton", @"controlBar", @"viewer", @"activeRoll", @"inspector", nil],
@"newButton", [PBNewRollButton view: [_DICT:
@"frame", _RECT( 15.0, 15.0, 270.0, 90.0 ),
@"target", @"PB",
@"action", @"newRoll:",
nil]],
@"controlBar", [PBControlBar view: [_DICT:
@"frame", _RECT( 0.0, 660.0, 1080.0, 150.0 ),
@"outlets", [_ARRAY: @"effectsButton", @"captureMode", @"countdownPanel", @"captureButton", @"printButton", nil],
@"effectsButton", [PBEffectsButton view: [_DICT:
@"frame", _RECT( 795.0, 45.0, 270.0, 60.0 ),
@"target", @"PB",
@"action", @"effectsChooser:",
@"opacityBinding", @"PB.controlBarControlOpacity",
nil]],
@"captureMode", [PBCaptureModeButton view: [_DICT:
@"frame", _RECT( 15.0, 45.0, 270.0, 60.0 ),
@"opacityBinding", @"PB.controlBarControlOpacity",
nil]],
@"countdownPanel", [SCView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 150.0 ),
@"rootLayer.backgroundColor", BLACKCOLOR,
@"opacityBinding", @"PB.countdownPanelOpacity",
nil]],
@"captureButton", [PBRoundButton view: [_DICT:
@"frame", _RECT( 480.0, 15.0, 120.0, 120.0 ),
@"target", @"PB",
@"action", @"capture:",
@"rootLayer.backgroundColor", REDCOLOR,
@"imageLayer.contents", (id)PBCaptureCameraIcon,
nil]],
@"printButton", [PBRoundButton view: [_DICT:
@"frame", _RECT( 930.0, 15.0, 120.0, 120.0 ),
@"target", @"PB",
@"action", @"showPrintInspector:",
@"rootLayer.backgroundColor", BLUECOLOR,
@"imageLayer.contents", (id)PBPrintIcon,
nil]],
nil]],
@"viewer", [SCTabView view: [_DICT:
@"frame", _RECT( 0.0, 810.0, 1080.0, 780.0 ),
@"rootLayer.name", @"viewer",
@"rootLayer.backgroundColor", BLACKCOLOR, // FIXME: make this settable on the view
@"nowShowingBinding", @"PB.viewerTab",
@"outlets", [_ARRAY: @"captureTab", @"effectChooserTab", @"editorTab", nil],
@"captureTab", [PBCaptureView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.name", @"capture",
@"visibleViewIndexBinding", @"PB.captureTab",
@"outlets", [_ARRAY: @"single", @"fourUp", @"movie", nil],
@"single", [PBSingleCaptureView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", GREENCOLOR,
@"captureSessionBinding", @"PB.captureSession",
nil]],
@"fourUp", [PBFourUpCaptureView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", REDCOLOR,
@"captureSessionBinding", @"PB.captureSession",
nil]],
@"movie", [PBMovieCaptureView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", BLUECOLOR,
@"captureSessionBinding", @"PB.captureSession",
nil]],
nil]],
@"effectChooserTab", [SCCarouselView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", GRAYCOLOR,
@"visibleViewIndexBinding", @"PB.effectTab",
@"outlets", [_ARRAY: @"first", @"second", @"third", nil],
@"first", [PBEffectsChooser view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", WHITECOLOR,
@"captureSessionBinding", @"PB.captureSession",
nil]],
@"second", [PBEffectsChooser view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", BLUECOLOR,
@"captureSessionBinding", @"PB.captureSession",
nil]],
@"third", [PBEffectsChooser view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", BLACKCOLOR,
@"captureSessionBinding", @"PB.captureSession",
nil]],
nil]],
@"editorTab", [PBEditView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.backgroundColor", GRAYCOLOR,
@"outlets", [_ARRAY: @"image", @"tool", nil],
@"image", [PBImageView view: [_DICT:
@"frame", _RECT( 15.0, 15.0, 1050.0, 750.0 ),
@"rootLayer.backgroundColor", WHITECOLOR,
@"rootLayer.contents", PBIcons,
nil]],
@"tool", [PBToolView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
@"rootLayer.name", @"tool",
@"nowShowing", @"transform",
@"outlets", [_ARRAY: @"transformTab", @"pencilTab", @"textTab", @"stampTab", nil],
@"transformTab", [PBTransformTool view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
nil]],
@"pencilTab", [PBPencilTool view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
nil]],
@"textTab", [PBTextTool view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
nil]],
@"stampTab", [PBStampTool view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 1080.0, 780.0 ),
nil]],
nil]],
nil]],
nil]],
@"activeRoll", [PBRollView view: [_DICT:
@"frame", _RECT( 0.0, 120.0, 300.0, 540.0 ),
@"rootLayer.backgroundColor", REDCOLOR,
nil]],
@"inspector", [SCTabView view: [_DICT:
@"frame", _RECT( 300.0, 0.0, 780.0, 660.0 ),
@"nowShowing", @"transform",
@"outlets", [_ARRAY:
@"archivedTab", @"transformTab", @"pencilTab", @"textTab", @"adjustTab",
@"stampTab", @"frameTab", @"trashTab", @"printTab",
nil],
@"archivedTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBArchivedPager view],
@"content", [SCTouchScrollView view: [_DICT:
@"outlets", [_ARRAY: @"collection", nil],
@"collection", [SCTouchCollectionView view: [_DICT:
@"exampleView", [PBRollView class],
nil]],
nil]],
nil]],
@"transformTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"startPage", @"move",
@"outlets", [_ARRAY: @"pathHeader", @"movePage", nil],
@"pathHeader", [PBPathView view: [_DICT:
@"size", _SIZE( 780.0, 60.0 ),
@"rootLayer.backgroundColor", BLUECOLOR,
nil]],
@"movePage", [SCTouchPageView view: [_DICT:
@"titleBinding", @"PB.windowTitle",
@"rootLayer.backgroundColor", GRAYCOLOR,
@"frame", _RECT( 0.0, 0.0, 780.0, 600.0 ),
@"outlets", [_ARRAY: @"enabledGroup", @"transformGroup", @"resetGroup", nil],
@"enabledGroup", [SCTouchControlGroupView view: [_DICT:
@"size", _SIZE( 780.0, 90.0 ),
@"outlets", [_ARRAY: @"inUse", nil],
@"inUse", [SCTouchToggleButtonView view: [_DICT:
@"label", @"Move",
nil]],
nil]],
@"transformGroup", [SCTouchControlGroupView view: [_DICT:
@"size", _SIZE( 780.0, 270.0 ),
@"outlets", [_ARRAY: @"scale", @"rotation", @"position", nil],
@"scale", [SCTouchSliderView view],
@"rotation", [SCTouchSliderView view],
@"position", [SCTouchPositionView view],
@"headerText", @"Click and drag on the picture to position and rotate it.",
nil]],
@"resetGroup", [SCTouchControlGroupView view: [_DICT:
@"size", _SIZE( 780.0, 90.0 ),
@"outlets", [_ARRAY: @"reset", nil],
@"reset", [SCTouchButtonView view: [_DICT:
@"title", @"Reset all transformations",
nil]],
nil]],
nil]],
nil]],
@"pencilTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBPathView view],
@"content", [SCTouchTabView view: [_DICT:
@"tabs", [_ARRAY:
[SCTouchPageView view: [_DICT:
@"title", @"Draw",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"inUse", nil],
@"inUse", [SCTouchToggleButtonView view: [_DICT:
@"label", @"Draw",
nil]],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"brush", @"size", @"color", nil],
@"brush", [SCTouchListSelectionView view],
@"size", [SCTouchListSelectionView view],
@"color", [SCTouchListSelectionView view],
@"headerText", @"Click and drag on the picture to draw. Flip pen and press to erase.",
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"pressureSensitive", @"opacity", @"mode", nil],
@"pressureSensitive", [SCTouchToggleButtonView view],
@"opacity", [SCTouchSliderView view],
@"mode", [SCTouchListSelectionView view],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"reset", nil],
@"reset", [SCTouchButtonView view: [_DICT:
@"title", @"Erase drawing layer",
nil]],
nil]],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Brush",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Size",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
[PBColorPage view],
[PBTouchColorPicker view], // must immediately follow PBColorPage
nil],
nil]],
nil]],
@"textTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBPathView view],
@"content", [SCTouchTabView view: [_DICT:
@"tabs", [_ARRAY:
[SCTouchPageView view: [_DICT:
@"title", @"Text",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"inUse", nil],
@"inUse", [SCTouchToggleButtonView view: [_DICT:
@"label", @"Text",
nil]],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"font", @"style", @"size", @"alignment", @"color", @"opacity", @"blend", nil],
@"font", [SCTouchListSelectionView view],
@"style", [SCTouchSegmentView view],
@"size", [SCTouchSliderView view],
@"alignment", [SCTouchSegmentView view],
@"color", [SCTouchListSelectionView view],
@"opacity", [SCTouchSliderView view],
@"blend", [SCTouchListSelectionView view],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"dropShadow", @"color", @"opacity", @"blur", @"offset", @"angle", nil],
@"dropShadow", [SCTouchToggleButtonView view],
@"color", [SCTouchListSelectionView view],
@"opacity", [SCTouchSliderView view],
@"blur", [SCTouchSliderView view],
@"offset", [SCTouchSliderView view],
@"angle", [SCTouchSliderView view],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"tracking", @"lineSpacing", nil],
@"tracking", [SCTouchSliderView view],
@"lineSpacing", [SCTouchSliderView view],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"reset", nil],
@"reset", [SCTouchButtonView view: [_DICT:
@"title", @"Erase text layer",
nil]],
nil]],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Font",
@"groups", [_ARRAY:
[SCTouchSelectionListView view], // FIXME: this should have a font example view
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Blend Mode",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
// font color
[PBColorPage view],
[PBTouchColorPicker view], // must immediately follow PBColorPage
// drop shadow color
[PBColorPage view],
[PBTouchColorPicker view], // must immediately follow PBColorPage
nil],
nil]],
nil]],
@"adjustTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBPathView view],
@"content", [SCTouchTabView view: [_DICT:
@"tabs", [_ARRAY:
[SCTouchPageView view: [_DICT:
@"title", @"Adjust",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"inUse", nil],
@"inUse", [SCTouchToggleButtonView view: [_DICT:
@"label", @"Adjust",
nil]],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"brightness", @"contrast", nil],
@"brightness", [SCTouchSliderView view],
@"contrast", [SCTouchSliderView view],
@"headerText", @"Brightness and Contrast",
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"saturation", @"temperature", @"tint", nil],
@"saturation", [SCTouchSliderView view],
@"temperature", [SCTouchSliderView view],
@"tint", [SCTouchSliderView view],
@"headerText", @"Saturation, Temperature, and Tint",
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"sharpness", @"noise", nil],
@"sharpness", [SCTouchSliderView view],
@"noise", [SCTouchSliderView view],
@"headerText", @"Sharpness and Noise",
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"exposure", @"levels", nil],
@"exposure", [SCTouchSliderView view],
@"levels", [SCTouchButtonView view],
@"headerText", @"Exposure and Levels",
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"reset", nil],
@"reset", [SCTouchButtonView view: [_DICT:
@"title", @"Reset image adjustments",
nil]],
nil]],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Levels",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"reset", nil],
@"reset", [SCTouchButtonView view: [_DICT:
@"title", @"Reset levels",
nil]],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"levels", nil],
@"levels", [PBTouchLevels view],
nil]],
nil],
nil]],
nil],
nil]],
nil]],
@"stampTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBPathView view],
@"content", [SCTouchTabView view: [_DICT:
@"tabs", [_ARRAY:
[SCTouchPageView view: [_DICT:
@"title", @"Stamp",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"inUse", nil],
@"inUse", [SCTouchToggleButtonView view: [_DICT:
@"label", @"Stamp",
nil]],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"stamp", @"scale", @"rotation", @"position", @"color", @"opacity", @"blend",nil],
@"stamp", [SCTouchListSelectionView view],
@"scale", [SCTouchSliderView view],
@"rotation", [SCTouchSliderView view],
@"position", [SCTouchPositionView view],
@"color", [SCTouchListSelectionView view],
@"opacity", [SCTouchSliderView view],
@"blend", [SCTouchListSelectionView view],
@"headerText", @"Click and drag on the stamp to position and rotate it.",
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"dropShadow", @"color", @"opacity", @"blur", @"offset", @"angle", nil],
@"dropShadow", [SCTouchToggleButtonView view],
@"color", [SCTouchListSelectionView view],
@"opacity", [SCTouchSliderView view],
@"blur", [SCTouchSliderView view],
@"offset", [SCTouchSliderView view],
@"angle", [SCTouchSliderView view],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"reset", nil],
@"reset", [SCTouchButtonView view: [_DICT:
@"title", @"Reset stamp to default settings",
nil]],
nil]],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Stamp",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Blend Mode",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
// stamp color
[PBColorPage view],
[PBTouchColorPicker view], // must immediately follow PBColorPage
// drop shadow color
[PBColorPage view],
[PBTouchColorPicker view], // must immediately follow PBColorPage
nil],
nil]],
nil]],
@"frameTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBPathView view],
@"content", [SCTouchTabView view: [_DICT:
@"tabs", [_ARRAY:
[SCTouchPageView view: [_DICT:
@"title", @"Frame",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"inUse", nil],
@"inUse", [SCTouchToggleButtonView view: [_DICT:
@"label", @"Frame",
nil]],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"shape", nil],
@"shape", [SCTouchListSelectionView view],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"reset", nil],
@"reset", [SCTouchButtonView view: [_DICT:
@"title", @"Reset frame to default settings",
nil]],
nil]],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Shape",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
nil],
nil]],
nil]],
@"trashTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBPathView view],
@"content", [SCTouchTabView view: [_DICT:
@"tabs", [_ARRAY:
[SCTouchPageView view: [_DICT:
@"title", @"Trash",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"current", nil],
@"current", [SCTouchButtonView view: [_DICT:
@"title", @"Trash this photo or video", // FIXME: bind to the correctly formatted string
nil]],
nil]],
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"roll", nil],
@"roll", [SCTouchButtonView view: [_DICT:
@"title", @"Trash the entire roll",
nil]],
nil]],
nil],
nil]],
nil],
nil]],
nil]],
@"printTab", [SCTouchBrowserView view: [_DICT:
@"frame", _RECT( 0.0, 0.0, 780.0, 660.0 ),
@"header", [PBPathView view],
@"content", [SCTouchTabView view: [_DICT:
@"tabs", [_ARRAY:
[SCTouchPageView view: [_DICT:
@"title", @"Print",
@"groups", [_ARRAY:
[SCTouchControlGroupView view: [_DICT:
@"outlets", [_ARRAY: @"copies", @"photos", nil],
@"copies", [SCTouchListSelectionView view],
@"photos", [SCTouchListSelectionView view],
nil]],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Copies",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
[SCTouchPageView view: [_DICT:
@"title", @"Photos",
@"groups", [_ARRAY:
[SCTouchSelectionListView view],
nil],
nil]],
nil],
nil]],
@"footer", [PBTouchPrintButton view],
nil]],
nil]],
nil]],
nil]],
nil]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment