summaryrefslogtreecommitdiff
path: root/ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/Classes/Commands/Path.m
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-29 12:00:16 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-29 12:00:16 -0700
commitdf00d3b046ee7b88eaf068b802411814ac97dfd2 (patch)
tree957fbaa9bdd3abde2a75e2f8d05c04359576bd5b /ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/Classes/Commands/Path.m
parent19735e70505a5f40fedede0b05764f5b1a1ef383 (diff)
downloadinfinitytier-df00d3b046ee7b88eaf068b802411814ac97dfd2.tar.gz
infinitytier-df00d3b046ee7b88eaf068b802411814ac97dfd2.zip
Going to have to continue to use the old MAC web-container-based UI on Macs prior to 10.10 even when the new UI comes out, and the new UI is not ready yet anyway, so resurrect this.
Diffstat (limited to 'ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/Classes/Commands/Path.m')
-rw-r--r--ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/Classes/Commands/Path.m53
1 files changed, 53 insertions, 0 deletions
diff --git a/ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/Classes/Commands/Path.m b/ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/Classes/Commands/Path.m
new file mode 100644
index 00000000..8c54100f
--- /dev/null
+++ b/ext/installfiles/mac/mac-ui-macgap1-wrapper/src/MacGap/Classes/Commands/Path.m
@@ -0,0 +1,53 @@
+#import "Path.h"
+
+@implementation Path
+
+@synthesize application;
+@synthesize resource;
+@synthesize documents;
+@synthesize library;
+@synthesize home;
+@synthesize temp;
+
+- (NSString *)application {
+ return [[NSBundle mainBundle] bundlePath];
+}
+
+- (NSString *)resource {
+ return [[NSBundle mainBundle] resourcePath];
+}
+
+- (NSString *)documents {
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ return [paths objectAtIndex:0];
+}
+
+- (NSString *)library {
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
+ NSLog( @"%@", paths );
+ return [paths objectAtIndex:0];
+}
+
+- (NSString *)home {
+ return NSHomeDirectory();
+}
+
+- (NSString *)temp {
+ return NSTemporaryDirectory();
+}
+
+#pragma mark WebScripting Protocol
+
+/* checks whether a selector is acceptable to be called from JavaScript */
++ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector
+{
+ return NO;
+}
+
+// right now exclude all properties (eg keys)
++ (BOOL) isKeyExcludedFromWebScript:(const char*)name
+{
+ return NO;
+}
+
+@end