Skip to content

Commit ea90796

Browse files
committed
initial
0 parents  commit ea90796

32 files changed

Lines changed: 16010 additions & 0 deletions

AnyBar.xcodeproj/project.pbxproj

Lines changed: 340 additions & 0 deletions
Large diffs are not rendered by default.

AnyBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>BuildLocationStyle</key>
6+
<string>UseAppPreferences</string>
7+
<key>CustomBuildLocationType</key>
8+
<string>RelativeToDerivedData</string>
9+
<key>DerivedDataLocationStyle</key>
10+
<string>Default</string>
11+
<key>IssueFilterStyle</key>
12+
<string>ShowActiveSchemeOnly</string>
13+
<key>LiveSourceIssuesEnabled</key>
14+
<true/>
15+
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
16+
<true/>
17+
<key>SnapshotLocationStyle</key>
18+
<string>Default</string>
19+
</dict>
20+
</plist>
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0610"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "C5AB32B71A8F9091002258B6"
18+
BuildableName = "AnyBar.app"
19+
BlueprintName = "AnyBar"
20+
ReferencedContainer = "container:AnyBar.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "C5AB32CA1A8F9091002258B6"
32+
BuildableName = "AnyBarTests.xctest"
33+
BlueprintName = "AnyBarTests"
34+
ReferencedContainer = "container:AnyBar.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
</BuildActionEntries>
38+
</BuildAction>
39+
<TestAction
40+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
41+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
42+
shouldUseLaunchSchemeArgsEnv = "YES"
43+
buildConfiguration = "Debug">
44+
<Testables>
45+
<TestableReference
46+
skipped = "NO">
47+
<BuildableReference
48+
BuildableIdentifier = "primary"
49+
BlueprintIdentifier = "C5AB32CA1A8F9091002258B6"
50+
BuildableName = "AnyBarTests.xctest"
51+
BlueprintName = "AnyBarTests"
52+
ReferencedContainer = "container:AnyBar.xcodeproj">
53+
</BuildableReference>
54+
</TestableReference>
55+
</Testables>
56+
<MacroExpansion>
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "C5AB32B71A8F9091002258B6"
60+
BuildableName = "AnyBar.app"
61+
BlueprintName = "AnyBar"
62+
ReferencedContainer = "container:AnyBar.xcodeproj">
63+
</BuildableReference>
64+
</MacroExpansion>
65+
</TestAction>
66+
<LaunchAction
67+
selectedDebuggerIdentifier = ""
68+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
69+
launchStyle = "0"
70+
useCustomWorkingDirectory = "NO"
71+
buildConfiguration = "Release"
72+
ignoresPersistentStateOnLaunch = "NO"
73+
debugDocumentVersioning = "YES"
74+
allowLocationSimulation = "YES">
75+
<BuildableProductRunnable>
76+
<BuildableReference
77+
BuildableIdentifier = "primary"
78+
BlueprintIdentifier = "C5AB32B71A8F9091002258B6"
79+
BuildableName = "AnyBar.app"
80+
BlueprintName = "AnyBar"
81+
ReferencedContainer = "container:AnyBar.xcodeproj">
82+
</BuildableReference>
83+
</BuildableProductRunnable>
84+
<AdditionalOptions>
85+
</AdditionalOptions>
86+
</LaunchAction>
87+
<ProfileAction
88+
shouldUseLaunchSchemeArgsEnv = "YES"
89+
savedToolIdentifier = ""
90+
useCustomWorkingDirectory = "NO"
91+
buildConfiguration = "Release"
92+
debugDocumentVersioning = "YES">
93+
<BuildableProductRunnable>
94+
<BuildableReference
95+
BuildableIdentifier = "primary"
96+
BlueprintIdentifier = "C5AB32B71A8F9091002258B6"
97+
BuildableName = "AnyBar.app"
98+
BlueprintName = "AnyBar"
99+
ReferencedContainer = "container:AnyBar.xcodeproj">
100+
</BuildableReference>
101+
</BuildableProductRunnable>
102+
</ProfileAction>
103+
<AnalyzeAction
104+
buildConfiguration = "Debug">
105+
</AnalyzeAction>
106+
<ArchiveAction
107+
buildConfiguration = "Release"
108+
revealArchiveInOrganizer = "YES">
109+
</ArchiveAction>
110+
</Scheme>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>AnyBar.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>C5AB32B71A8F9091002258B6</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
<key>C5AB32CA1A8F9091002258B6</key>
21+
<dict>
22+
<key>primary</key>
23+
<true/>
24+
</dict>
25+
</dict>
26+
</dict>
27+
</plist>

AnyBar/AppDelegate.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// AppDelegate.h
3+
// AnyBar
4+
//
5+
// Created by Nikita Prokopov on 14/02/15.
6+
// Copyright (c) 2015 Nikita Prokopov. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "GCDAsyncUdpSocket.h"
11+
12+
@interface AppDelegate : NSObject <NSApplicationDelegate>
13+
14+
15+
@end
16+

AnyBar/AppDelegate.m

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//
2+
// AppDelegate.m
3+
// AnyBar
4+
//
5+
// Created by Nikita Prokopov on 14/02/15.
6+
// Copyright (c) 2015 Nikita Prokopov. All rights reserved.
7+
//
8+
9+
#import "AppDelegate.h"
10+
11+
@interface AppDelegate ()
12+
13+
@property (weak) IBOutlet NSWindow *window;
14+
@property (strong, nonatomic) NSStatusItem *statusItem;
15+
@property GCDAsyncUdpSocket *udpSocket;
16+
17+
@end
18+
19+
@implementation AppDelegate
20+
21+
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
22+
self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
23+
_statusItem.image = [NSImage imageNamed:@"white@2x.png"];
24+
_statusItem.alternateImage = [NSImage imageNamed:@"alternate@2x.png"];
25+
_statusItem.highlightMode = YES;
26+
27+
NSString *portStr = [[[NSProcessInfo processInfo] environment] objectForKey:@"ANYBAR_PORT"];
28+
if (portStr == nil) {
29+
portStr = @"1738";
30+
}
31+
int port = [portStr intValue];
32+
33+
NSMenu *menu = [[NSMenu alloc] init];
34+
NSString *portTitle = [@"UDP port " stringByAppendingString:portStr];
35+
[menu addItemWithTitle:portTitle action:nil keyEquivalent:@""];
36+
[menu addItemWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@""];
37+
_statusItem.menu = menu;
38+
39+
_udpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
40+
NSError *error = nil;
41+
[_udpSocket bindToPort:port error:&error];
42+
[_udpSocket beginReceiving:&error];
43+
}
44+
45+
- (void)applicationWillTerminate:(NSNotification *)aNotification {
46+
}
47+
48+
- (void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data
49+
fromAddress:(NSData *)address
50+
withFilterContext:(id)filterContext
51+
{
52+
NSString *msg = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
53+
if ([msg isEqualToString:@"quit"]) {
54+
[[NSApplication sharedApplication] terminate:nil];
55+
} else {
56+
NSString *file = [msg stringByAppendingString:@"@2x.png"];
57+
self.statusItem.image = [NSImage imageNamed:file];
58+
}
59+
}
60+
61+
62+
@end

AnyBar/Base.lproj/MainMenu.xib

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
5+
</dependencies>
6+
<objects>
7+
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
8+
<connections>
9+
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
10+
</connections>
11+
</customObject>
12+
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
13+
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
14+
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
15+
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
16+
</objects>
17+
</document>

0 commit comments

Comments
 (0)