diff --git a/Slate/AccessibilityWrapper.h b/Slate/AccessibilityWrapper.h index c40918f0..2652a0af 100644 --- a/Slate/AccessibilityWrapper.h +++ b/Slate/AccessibilityWrapper.h @@ -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; diff --git a/Slate/AccessibilityWrapper.m b/Slate/AccessibilityWrapper.m index d2718b0b..414ac9d5 100644 --- a/Slate/AccessibilityWrapper.m +++ b/Slate/AccessibilityWrapper.m @@ -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]]; } diff --git a/Slate/JSWindowWrapper.m b/Slate/JSWindowWrapper.m index e8f4c688..82b49089 100644 --- a/Slate/JSWindowWrapper.m +++ b/Slate/JSWindowWrapper.m @@ -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]]; } @@ -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",