Skip to content

Commit

Permalink
[jigish#218] add isMovable and isResizable to window
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigish Patel committed Jan 31, 2013
1 parent 141f617 commit 20a4950
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Slate/AccessibilityWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
+ (AXUIElementRef)focusedWindowInRunningApp:(NSRunningApplication *)app;
+ (BOOL)isMainWindow:(AXUIElementRef)window;
+ (NSString *)getTitle:(AXUIElementRef)window;
- (BOOL)isMovable;
- (BOOL)isResizable;
+ (BOOL)isWindowMinimizedOrHidden:(AXUIElementRef)window inApp:(AXUIElementRef)app;
+ (AXUIElementRef)windowUnderPoint:(NSPoint)point;
+ (void)createSystemWideElement;
Expand Down
8 changes: 8 additions & 0 deletions Slate/AccessibilityWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ - (BOOL)isMinimizedOrHidden {
return [AccessibilityWrapper isWindowMinimizedOrHidden:[self window] inApp:[self app]];
}

- (BOOL)isMovable {
return [self moveWindow:[self getCurrentTopLeft]];
}

- (BOOL)isResizable {
return [self resizeWindow:[self getCurrentSize]];
}

- (NSString *)getTitle {
return [AccessibilityWrapper getTitle:[self window]];
}
Expand Down
10 changes: 10 additions & 0 deletions Slate/JSWindowWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ - (BOOL)isMinimizedOrHidden {
return [aw isMinimizedOrHidden];
}

- (BOOL)isMovable {
return [aw isMovable];
}

- (BOOL)isResizable {
return [aw isResizable];
}

- (BOOL)isMain {
return [AccessibilityWrapper isMainWindow:[aw window]];
}
Expand Down Expand Up @@ -142,6 +150,8 @@ + (void)setJsMethods {
NSStringFromSelector(@selector(pid)): @"pid",
NSStringFromSelector(@selector(focus)): @"focus",
NSStringFromSelector(@selector(isMinimizedOrHidden)): @"isMinimizedOrHidden",
NSStringFromSelector(@selector(isMovable)): @"isMovable",
NSStringFromSelector(@selector(isResizable)): @"isResizable",
NSStringFromSelector(@selector(isMain)): @"isMain",
NSStringFromSelector(@selector(move:)): @"move",
NSStringFromSelector(@selector(resize:)): @"resize",
Expand Down

0 comments on commit 20a4950

Please sign in to comment.