Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: Crazor/Tile
base: e513402c28
...
head fork: Crazor/Tile
compare: 544bd5a6fb
  • 8 commits
  • 15 files changed
  • 0 commit comments
  • 1 contributor
3  .gitignore
View
@@ -1,3 +1,6 @@
build/
*.swp
.DS_Store
+DerivedData
+Tile.xcodeproj/project.xcworkspace
+Tile.xcodeproj/xcuserdata
10 Application.h
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009-2011 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,8 +17,6 @@
* along with Tile. If not, see <http://www.gnu.org/licenses/>.
*/
-#import <Cocoa/Cocoa.h>
-
@class Window;
@class GTMAXUIElement;
@@ -26,18 +24,18 @@
AXObserverRef observer;
NSString *identifier;
NSString *name;
- NSNumber *pid;
+ pid_t pid;
GTMAXUIElement *element;
NSMutableArray *windows;
}
@property(copy) NSString *identifier;
@property(copy) NSString *name;
-@property(assign) NSNumber *pid;
+@property(assign) pid_t pid;
@property(retain) GTMAXUIElement *element;
@property(retain) NSMutableArray *windows;
-- (id)initWithDict:(NSDictionary *)appDict;
+- (id)initWithRunningApplication:(NSRunningApplication *)runningApplication;
- (NSArray *)attributes;
- (void)registerAXObserver;
- (void)unregisterAXObserver;
16 Application.m
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009-2011 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,16 +47,15 @@ @implementation Application
@synthesize element;
@synthesize windows;
-- (id)initWithDict:(NSDictionary *)appDict
+- (id)initWithRunningApplication:(NSRunningApplication *)runningApplication
{
if ((self = [super init]))
{
[self setWindows:[NSMutableArray array]];
-
- [self setPid: [appDict objectForKey:@"NSApplicationProcessIdentifier"]];
- [self setIdentifier:[appDict objectForKey:@"NSApplicationBundleIdentifier"]];
- [self setName: [appDict objectForKey:@"NSApplicationName"]];
- [self setElement: [GTMAXUIElement elementWithProcessIdentifier:(pid_t)[pid longValue]]];
+ [self setPid: [runningApplication processIdentifier]];
+ [self setIdentifier:[runningApplication bundleIdentifier]];
+ [self setName: [runningApplication localizedName]];
+ [self setElement: [GTMAXUIElement elementWithProcessIdentifier:pid]];
for (GTMAXUIElement *e in [[self element] accessibilityAttributeValue:(NSString *)kAXWindowsAttribute])
{
@@ -75,7 +74,6 @@ - (void)dealloc
[self unregisterAXObserver];
[[self identifier] release];
[[self name] release];
- [[self pid] release];
[[self element] release];
[[self windows] release];
@@ -84,7 +82,7 @@ - (void)dealloc
- (void)registerAXObserver
{
- if (AXObserverCreate((pid_t)[[self pid] longValue], axObserverCallback, &observer))
+ if (AXObserverCreate(pid, axObserverCallback, &observer))
{
NSLog(@"Error creating AXObserver for %@", [self identifier]);
return;
4 Area.h
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009-2011 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,8 +17,6 @@
* along with Tile. If not, see <http://www.gnu.org/licenses/>.
*/
-#import <Cocoa/Cocoa.h>
-
@class Window;
@interface Area : NSObject {
2  Area.m
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009-2011 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
4 AreaController.h
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009, 2010 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,8 +17,6 @@
* along with Tile. If not, see <http://www.gnu.org/licenses/>.
*/
-#import <Cocoa/Cocoa.h>
-
@class Area;
@interface AreaController : NSObject {
4 AreaController.m
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009-2011 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -63,7 +63,7 @@ - (void)awakeFromNib
- (void)discoverScreens
{
NSArray *screens = [NSScreen screens];
- NSLog(@"Found %d screens.", [screens count]);
+ NSLog(@"Found %lu screens.", [screens count]);
for (int i = 0; i < [screens count]; i++)
{
3  EventController.h
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009, 2010 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +17,6 @@
* along with Tile. If not, see <http://www.gnu.org/licenses/>.
*/
-#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
#define EVENT_ID_MAX 0x80
12 EventController.m
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009, 2010 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -54,6 +54,16 @@ - (void)awakeFromNib
[self setSelector:@selector(quit) ofTarget:self forActionID:12]; // Q
[self setSelector:@selector(maximizeCurrentWindow) ofTarget:wc forActionID:46]; // M
[self setSelector:@selector(centerCurrentWindow) ofTarget:wc forActionID: 8]; // C
+
+ [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self
+ selector: @selector(userDefaultsDidChange:)
+ name: NSUserDefaultsDidChangeNotification
+ object: NULL];
+}
+
+- (void)userDefaultsDidChange: (NSNotification *)notification
+{
+ NSLog(@"User Defaults did change. Name: %@", [notification name]);
}
- (void)registerLeaderHandler
18 Tile.xcodeproj/project.pbxproj
View
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -173,8 +173,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Tile" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -237,7 +240,6 @@
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -245,7 +247,7 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = Tile;
- SDKROOT = macosx10.7;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -261,7 +263,7 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = Tile;
- SDKROOT = macosx10.7;
+ SDKROOT = macosx;
};
name = Release;
};
@@ -274,8 +276,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.7;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -286,8 +287,7 @@
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.7;
+ SDKROOT = macosx;
};
name = Release;
};
4 Window.h
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009-2011 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,8 +17,6 @@
* along with Tile. If not, see <http://www.gnu.org/licenses/>.
*/
-#import <Cocoa/Cocoa.h>
-
#import "Area.h"
@class GTMAXUIElement;
4 Window.m
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009-2011 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -120,7 +120,7 @@ - (NSArray *)attributes
- (void)registerAXObserver
{
- if (AXObserverCreate((pid_t)[[[self application] pid] longValue], axObserverCallback, &observer))
+ if (AXObserverCreate([[self application] pid], axObserverCallback, &observer))
{
NSLog(@"Error creating AXObserver for %@", self);
return;
4 WindowController.h
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009, 2010 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,8 +17,6 @@
* along with Tile. If not, see <http://www.gnu.org/licenses/>.
*/
-#import <Cocoa/Cocoa.h>
-
@class GTMAXUIElement;
@class Application;
@class Window;
11 WindowController.m
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009, 2010 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -100,10 +100,10 @@ - (void)populateAppList
{
// Populate appList with running apps
NSWorkspace *ws = [NSWorkspace sharedWorkspace];
- NSDictionary *appDict;
- for (appDict in [ws launchedApplications])
+ NSRunningApplication *runningApplication;
+ for (runningApplication in [ws runningApplications])
{
- [[self applications] addObject:[[Application alloc] initWithDict:appDict]];
+ [[self applications] addObject:[[Application alloc] initWithRunningApplication:runningApplication]];
}
}
@@ -129,7 +129,8 @@ - (void)removeApp:(NSDictionary *)appDict
- (void)appLaunched:(NSNotification *)notification
{
- [[self applications] addObject:[[Application alloc] initWithDict:[notification userInfo]]];
+ [[self applications] addObject:[[Application alloc] initWithRunningApplication:[[notification userInfo] objectForKey:@"NSWorkspaceApplicationKey"]]];
+ NSLog(@"appLaunched %@", [[notification userInfo] objectForKey:@"NSWorkspaceApplicationKey"]);
}
- (void)appTerminated:(NSNotification *)notification
3  main.m
View
@@ -1,7 +1,7 @@
/*
* This file is part of the Tile project.
*
- * Copyright 2009, 2010 Crazor <crazor@gmail.com>
+ * Copyright 2009-2012 Crazor <crazor@gmail.com>
*
* Tile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +17,6 @@
* along with Tile. If not, see <http://www.gnu.org/licenses/>.
*/
-#import <Cocoa/Cocoa.h>
#import "AreaController.h"
#import "WindowController.h"
#import "EventController.h"

No commit comments for this range

Something went wrong with that request. Please try again.