Commit a222fefc authored by Aral Balkan's avatar Aral Balkan

Initial add.

parent 5cf2bd35
......@@ -12,6 +12,9 @@
A742342B1A86748A00493C05 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A742342A1A86748A00493C05 /* Images.xcassets */; };
A742342E1A86748A00493C05 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A742342C1A86748A00493C05 /* Main.storyboard */; };
A742343A1A86748A00493C05 /* LayerCompositingSpikeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A74234391A86748A00493C05 /* LayerCompositingSpikeTests.swift */; };
A74234451A8674C300493C05 /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A74234431A8674C300493C05 /* MainWindowController.swift */; };
A742344A1A86784E00493C05 /* topLeftCornerIndicatorTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A74234491A86784E00493C05 /* topLeftCornerIndicatorTemplate@2x.png */; };
A742344C1A8678EE00493C05 /* transparent-star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A742344B1A8678EE00493C05 /* transparent-star@2x.png */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -34,6 +37,9 @@
A74234331A86748A00493C05 /* LayerCompositingSpikeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LayerCompositingSpikeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
A74234381A86748A00493C05 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A74234391A86748A00493C05 /* LayerCompositingSpikeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayerCompositingSpikeTests.swift; sourceTree = "<group>"; };
A74234431A8674C300493C05 /* MainWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = "<group>"; };
A74234491A86784E00493C05 /* topLeftCornerIndicatorTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "topLeftCornerIndicatorTemplate@2x.png"; sourceTree = "<group>"; };
A742344B1A8678EE00493C05 /* transparent-star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "transparent-star@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -75,11 +81,14 @@
A74234231A86748A00493C05 /* LayerCompositingSpike */ = {
isa = PBXGroup;
children = (
A742344B1A8678EE00493C05 /* transparent-star@2x.png */,
A74234491A86784E00493C05 /* topLeftCornerIndicatorTemplate@2x.png */,
A74234261A86748A00493C05 /* AppDelegate.swift */,
A74234281A86748A00493C05 /* ViewController.swift */,
A742342A1A86748A00493C05 /* Images.xcassets */,
A742342C1A86748A00493C05 /* Main.storyboard */,
A74234241A86748A00493C05 /* Supporting Files */,
A74234431A8674C300493C05 /* MainWindowController.swift */,
);
path = LayerCompositingSpike;
sourceTree = "<group>";
......@@ -190,6 +199,8 @@
buildActionMask = 2147483647;
files = (
A742342B1A86748A00493C05 /* Images.xcassets in Resources */,
A742344C1A8678EE00493C05 /* transparent-star@2x.png in Resources */,
A742344A1A86784E00493C05 /* topLeftCornerIndicatorTemplate@2x.png in Resources */,
A742342E1A86748A00493C05 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -210,6 +221,7 @@
files = (
A74234291A86748A00493C05 /* ViewController.swift in Sources */,
A74234271A86748A00493C05 /* AppDelegate.swift in Sources */,
A74234451A8674C300493C05 /* MainWindowController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A74234201A86748A00493C05"
BuildableName = "LayerCompositingSpike.app"
BlueprintName = "LayerCompositingSpike"
ReferencedContainer = "container:LayerCompositingSpike.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A74234321A86748A00493C05"
BuildableName = "LayerCompositingSpikeTests.xctest"
BlueprintName = "LayerCompositingSpikeTests"
ReferencedContainer = "container:LayerCompositingSpike.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A74234321A86748A00493C05"
BuildableName = "LayerCompositingSpikeTests.xctest"
BlueprintName = "LayerCompositingSpikeTests"
ReferencedContainer = "container:LayerCompositingSpike.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A74234201A86748A00493C05"
BuildableName = "LayerCompositingSpike.app"
BlueprintName = "LayerCompositingSpike"
ReferencedContainer = "container:LayerCompositingSpike.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A74234201A86748A00493C05"
BuildableName = "LayerCompositingSpike.app"
BlueprintName = "LayerCompositingSpike"
ReferencedContainer = "container:LayerCompositingSpike.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A74234201A86748A00493C05"
BuildableName = "LayerCompositingSpike.app"
BlueprintName = "LayerCompositingSpike"
ReferencedContainer = "container:LayerCompositingSpike.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>LayerCompositingSpike.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>A74234201A86748A00493C05</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>A74234321A86748A00493C05</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="6198" systemVersion="14A297b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6198"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<scenes>
<!--Application-->
......@@ -641,15 +641,15 @@
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="LayerCompositingSpike" customModuleProvider="target"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
</scene>
<!--Window Controller - Window-->
<!--Window Controller-->
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
<windowController id="B8D-0N-5wS" customClass="MainWindowController" customModule="LayerCompositingSpike" customModuleProvider="target" sceneMemberID="viewController">
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
......@@ -667,15 +667,55 @@
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>
</view>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="LayerCompositingSpike" customModuleProvider="target" sceneMemberID="viewController">
<visualEffectView key="view" appearanceType="vibrantLight" blendingMode="behindWindow" material="appearanceBased" state="followsWindowActiveState" id="HFO-ll-vcU">
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VGb-H9-d3T">
<rect key="frame" x="18" y="263" width="414" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="This is a label with default system font" id="hAc-5y-guu">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="U2p-5r-0P6">
<rect key="frame" x="18" y="216" width="414" height="39"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="A larger label with a custom font." id="6BI-dW-xsh">
<font key="font" size="20" name="AvenirNext-Regular"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VKz-NZ-cBS">
<rect key="frame" x="177" y="19" width="97" height="19"/>
<buttonCell key="cell" type="roundRect" title="Show overlay" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="AKg-qw-8ol">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="controlContent"/>
</buttonCell>
<connections>
<action selector="showOverlay:" target="XfG-lQ-9wD" id="Ghe-d7-QXi"/>
</connections>
</button>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4Yy-ec-Tc2">
<rect key="frame" x="106" y="57" width="150" height="150"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="transparent-star" id="qlo-xG-WoB"/>
</imageView>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Szv-b7-sNA">
<rect key="frame" x="296" y="119" width="26" height="26"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="topLeftCornerIndicatorTemplate" id="H2v-3N-dwA"/>
</imageView>
</subviews>
</visualEffectView>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="655"/>
</scene>
</scenes>
<resources>
<image name="topLeftCornerIndicatorTemplate" width="26" height="26"/>
<image name="transparent-star" width="150" height="143"/>
</resources>
</document>
//
// MainWindowController.swift
// LayerCompositingSpike
//
// Created by Aral Balkan on 07/02/2015.
// Copyright (c) 2015 Ind.ie. All rights reserved.
//
import Cocoa
class MainWindowController: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()
NSNotificationCenter.defaultCenter().addObserver(self, selector: "showOverlay", name: "showOverlay", object: nil)
}
func showOverlay()
{
println("Showing overlay.")
if let window = self.window
{
if let layer = window.contentView.layer?
{
if let bounds = window.contentView.bounds
{
let blankingView = NSView(frame: bounds)
let layer = CALayer()
blankingView.layer = layer
blankingView.wantsLayer = true
layer.backgroundColor = NSColor.redColor().CGColor
layer.opacity = 0.50
window.contentView.addSubview(blankingView)
}
}
}
}
}
......@@ -10,18 +10,13 @@ import Cocoa
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
override func viewWillAppear() {
self.view.wantsLayer = true
}
override var representedObject: AnyObject? {
didSet {
// Update the view, if already loaded.
}
@IBAction func showOverlay(sender: AnyObject) {
NSNotificationCenter.defaultCenter().postNotificationName("showOverlay", object: self)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment