Преглед на файлове

IDE header cleanup and some IDE fixes

Ivan Safrin преди 14 години
родител
ревизия
695a105915
променени са 41 файла, в които са добавени 837 реда и са изтрити 90 реда
  1. 2 0
      .gitignore
  2. BIN
      Assets/Icons/main_icon.png
  3. 7 0
      Core/Contents/Include/PolyCore.h
  4. 2 0
      Core/Contents/Source/PolyCocoaCore.mm
  5. 4 0
      Core/Contents/Source/PolyCore.cpp
  6. 69 3
      IDE/Build/Mac OS X/English.lproj/MainMenu.xib
  7. 2 2
      IDE/Build/Mac OS X/Polycode-Info.plist
  8. 6 0
      IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj
  9. 7 5
      IDE/Build/Mac OS X/PolycodeAppDelegate.h
  10. 19 5
      IDE/Build/Mac OS X/PolycodeAppDelegate.m
  11. 21 1
      IDE/Contents/Include/NewFileWindow.h
  12. 22 1
      IDE/Contents/Include/NewProjectWindow.h
  13. 22 1
      IDE/Contents/Include/PolycodeEditor.h
  14. 22 1
      IDE/Contents/Include/PolycodeEditorManager.h
  15. 21 1
      IDE/Contents/Include/PolycodeFontEditor.h
  16. 31 8
      IDE/Contents/Include/PolycodeFrame.h
  17. 22 1
      IDE/Contents/Include/PolycodeGlobals.h
  18. 25 8
      IDE/Contents/Include/PolycodeIDEApp.h
  19. 22 1
      IDE/Contents/Include/PolycodeImageEditor.h
  20. 21 1
      IDE/Contents/Include/PolycodeProject.h
  21. 22 1
      IDE/Contents/Include/PolycodeProjectBrowser.h
  22. 21 2
      IDE/Contents/Include/PolycodeProjectManager.h
  23. 21 1
      IDE/Contents/Include/PolycodeTextEditor.h
  24. 37 0
      IDE/Contents/Include/PolycodeToolLauncher.h
  25. BIN
      IDE/Contents/Resources/Images/barlogo.png
  26. BIN
      IDE/Contents/Resources/Images/play_button.png
  27. BIN
      IDE/Contents/Resources/Images/welcome.png
  28. 7 16
      IDE/Contents/Resources/ProjectTemplates/Basic/2D Project/template.polyproject
  29. 22 1
      IDE/Contents/Source/NewFileWindow.cpp
  30. 21 1
      IDE/Contents/Source/NewProjectWindow.cpp
  31. 21 1
      IDE/Contents/Source/PolycodeEditor.cpp
  32. 22 1
      IDE/Contents/Source/PolycodeEditorManager.cpp
  33. 21 1
      IDE/Contents/Source/PolycodeFontEditor.cpp
  34. 56 11
      IDE/Contents/Source/PolycodeFrame.cpp
  35. 50 11
      IDE/Contents/Source/PolycodeIDEApp.cpp
  36. 22 1
      IDE/Contents/Source/PolycodeImageEditor.cpp
  37. 21 0
      IDE/Contents/Source/PolycodeProject.cpp
  38. 21 1
      IDE/Contents/Source/PolycodeProjectBrowser.cpp
  39. 27 1
      IDE/Contents/Source/PolycodeProjectManager.cpp
  40. 21 1
      IDE/Contents/Source/PolycodeTextEditor.cpp
  41. 57 0
      IDE/Contents/Source/PolycodeToolLauncher.cpp

+ 2 - 0
.gitignore

@@ -46,6 +46,8 @@ Player/Build/Mac OS X/Polycode Player.xcodeproj/project.xcworkspace/xcuserdata/i
 /Dependencies/Downloads
 /Dependencies/Downloads
 /Dependencies/Local/libstem_gamepad/Build
 /Dependencies/Local/libstem_gamepad/Build
 
 
+/IDE/Contents/Resources/Standalone
+
 /Core/Build/Mac\ OS\ X/build
 /Core/Build/Mac\ OS\ X/build
 /IDE/Build/Mac\ OS\ X/build
 /IDE/Build/Mac\ OS\ X/build
 /Modules/Build/Mac\ OS\ X/build
 /Modules/Build/Mac\ OS\ X/build

BIN
Assets/Icons/main_icon.png


+ 7 - 0
Core/Contents/Include/PolyCore.h

@@ -272,8 +272,15 @@ namespace Polycode {
 		
 		
 		static const int EVENT_CORE_RESIZE = 0;		
 		static const int EVENT_CORE_RESIZE = 0;		
 		
 		
+		/**
+		* Returns the default working path of the application.
+		*/
+		String getDefaultWorkingDirectory();
+		
 	protected:
 	protected:
 		
 		
+		String defaultWorkingDirectory;
+		
 		void *userPointer;
 		void *userPointer;
 		
 		
 		long refreshInterval;
 		long refreshInterval;

+ 2 - 0
Core/Contents/Source/PolyCocoaCore.mm

@@ -39,6 +39,8 @@ CocoaCore::CocoaCore(PolycodeView *view, int xRes, int yRes, bool fullScreen, bo
 //	NSLog(@"BUNDLE: %@", [[NSBundle mainBundle] bundlePath]);
 //	NSLog(@"BUNDLE: %@", [[NSBundle mainBundle] bundlePath]);
 	chdir([[[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/Resources"] UTF8String]);
 	chdir([[[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/Resources"] UTF8String]);
 	
 	
+	defaultWorkingDirectory = String([[[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/Resources"] UTF8String]);
+	
 	NSOpenGLPixelFormatAttribute attrs[32];
 	NSOpenGLPixelFormatAttribute attrs[32];
 	
 	
 	int atindx = 0;
 	int atindx = 0;

+ 4 - 0
Core/Contents/Source/PolyCore.cpp

@@ -78,6 +78,10 @@ namespace Polycode {
 		running = false;
 		running = false;
 	}
 	}
 	
 	
+	String Core::getDefaultWorkingDirectory() {
+		return defaultWorkingDirectory;
+	}
+	
 	Number Core::getElapsed() {
 	Number Core::getElapsed() {
 		return ((Number)elapsed)/1000.0f;
 		return ((Number)elapsed)/1000.0f;
 	}
 	}

+ 69 - 3
IDE/Build/Mac OS X/English.lproj/MainMenu.xib

@@ -620,7 +620,6 @@
 							<object class="NSPSMatrix" key="NSDrawMatrix"/>
 							<object class="NSPSMatrix" key="NSDrawMatrix"/>
 							<string key="NSFrameSize">{800, 600}</string>
 							<string key="NSFrameSize">{800, 600}</string>
 							<reference key="NSSuperview" ref="439893737"/>
 							<reference key="NSSuperview" ref="439893737"/>
-							<reference key="NSWindow"/>
 							<reference key="NSNextKeyView"/>
 							<reference key="NSNextKeyView"/>
 							<object class="NSOpenGLPixelFormat" key="NSPixelFormat">
 							<object class="NSOpenGLPixelFormat" key="NSPixelFormat">
 								<object class="NSMutableData" key="NSPixelAttributes">
 								<object class="NSMutableData" key="NSPixelAttributes">
@@ -631,7 +630,6 @@
 					</object>
 					</object>
 					<string key="NSFrameSize">{800, 600}</string>
 					<string key="NSFrameSize">{800, 600}</string>
 					<reference key="NSSuperview"/>
 					<reference key="NSSuperview"/>
-					<reference key="NSWindow"/>
 					<reference key="NSNextKeyView" ref="633009941"/>
 					<reference key="NSNextKeyView" ref="633009941"/>
 				</object>
 				</object>
 				<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
 				<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
@@ -952,6 +950,14 @@
 					</object>
 					</object>
 					<int key="connectionID">567</int>
 					<int key="connectionID">567</int>
 				</object>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">runProject:</string>
+						<reference key="source" ref="976324537"/>
+						<reference key="destination" ref="193606301"/>
+					</object>
+					<int key="connectionID">568</int>
+				</object>
 			</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 				<object class="NSArray" key="orderedObjects">
@@ -1637,7 +1643,7 @@
 				<reference key="dict.values" ref="0"/>
 				<reference key="dict.values" ref="0"/>
 			</object>
 			</object>
 			<nil key="sourceID"/>
 			<nil key="sourceID"/>
-			<int key="maxID">567</int>
+			<int key="maxID">568</int>
 		</object>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1712,6 +1718,66 @@
 				<object class="IBPartialClassDescription">
 				<object class="IBPartialClassDescription">
 					<string key="className">PolycodeAppDelegate</string>
 					<string key="className">PolycodeAppDelegate</string>
 					<string key="superclassName">NSObject</string>
 					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>closeProject:</string>
+							<string>newFile:</string>
+							<string>newProject:</string>
+							<string>openProject:</string>
+							<string>runProject:</string>
+							<string>saveFile:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>closeProject:</string>
+							<string>newFile:</string>
+							<string>newProject:</string>
+							<string>openProject:</string>
+							<string>runProject:</string>
+							<string>saveFile:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">closeProject:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">newFile:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">newProject:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">openProject:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">runProject:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveFile:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
 					<object class="NSMutableDictionary" key="outlets">
 					<object class="NSMutableDictionary" key="outlets">
 						<bool key="EncodedWithXMLCoder">YES</bool>
 						<bool key="EncodedWithXMLCoder">YES</bool>
 						<object class="NSArray" key="dict.sortedKeys">
 						<object class="NSArray" key="dict.sortedKeys">

+ 2 - 2
IDE/Build/Mac OS X/Polycode-Info.plist

@@ -9,7 +9,7 @@
 	<key>CFBundleIconFile</key>
 	<key>CFBundleIconFile</key>
 	<string>main_icon</string>
 	<string>main_icon</string>
 	<key>CFBundleIdentifier</key>
 	<key>CFBundleIdentifier</key>
-	<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+	<string>org.polycode.${PRODUCT_NAME:rfc1034identifier}</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<string>6.0</string>
 	<key>CFBundleName</key>
 	<key>CFBundleName</key>
@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
+	<string>0.8.2</string>
 	<key>CFBundleSignature</key>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<string>????</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>

+ 6 - 0
IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj

@@ -10,6 +10,7 @@
 		1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
 		1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
 		256AC3DA0F4B6AC300CF3369 /* PolycodeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* PolycodeAppDelegate.m */; };
 		256AC3DA0F4B6AC300CF3369 /* PolycodeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* PolycodeAppDelegate.m */; };
 		6D34143412B816BC0034FA9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34143312B816BC0034FA9B /* IOKit.framework */; };
 		6D34143412B816BC0034FA9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34143312B816BC0034FA9B /* IOKit.framework */; };
+		6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */; };
 		6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */; };
 		6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */; };
 		6D80E91E12AB53FB0037A708 /* PolycodeFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91912AB53FB0037A708 /* PolycodeFrame.cpp */; };
 		6D80E91E12AB53FB0037A708 /* PolycodeFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91912AB53FB0037A708 /* PolycodeFrame.cpp */; };
 		6D80E91F12AB53FB0037A708 /* PolycodeIDEApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91A12AB53FB0037A708 /* PolycodeIDEApp.cpp */; };
 		6D80E91F12AB53FB0037A708 /* PolycodeIDEApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91A12AB53FB0037A708 /* PolycodeIDEApp.cpp */; };
@@ -65,6 +66,8 @@
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
 		6D34143312B816BC0034FA9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
 		6D34143312B816BC0034FA9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
+		6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolycodeToolLauncher.cpp; sourceTree = "<group>"; };
+		6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeToolLauncher.h; sourceTree = "<group>"; };
 		6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewFileWindow.h; sourceTree = "<group>"; };
 		6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewFileWindow.h; sourceTree = "<group>"; };
 		6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFileWindow.cpp; sourceTree = "<group>"; };
 		6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFileWindow.cpp; sourceTree = "<group>"; };
 		6D80E91312AB53FB0037A708 /* PolycodeFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeFrame.h; sourceTree = "<group>"; };
 		6D80E91312AB53FB0037A708 /* PolycodeFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeFrame.h; sourceTree = "<group>"; };
@@ -229,6 +232,7 @@
 		6D80E91212AB53FB0037A708 /* Include */ = {
 		6D80E91212AB53FB0037A708 /* Include */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */,
 				6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */,
 				6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */,
 				6D91B3B312AF2B1600261ED4 /* PolycodeTextEditor.h */,
 				6D91B3B312AF2B1600261ED4 /* PolycodeTextEditor.h */,
 				6DCE865312AE146600566FAE /* PolycodeFontEditor.h */,
 				6DCE865312AE146600566FAE /* PolycodeFontEditor.h */,
@@ -250,6 +254,7 @@
 		6D80E91812AB53FB0037A708 /* Source */ = {
 		6D80E91812AB53FB0037A708 /* Source */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */,
 				6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */,
 				6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */,
 				6D91B3B412AF2B1D00261ED4 /* PolycodeTextEditor.cpp */,
 				6D91B3B412AF2B1D00261ED4 /* PolycodeTextEditor.cpp */,
 				6DCE865412AE146C00566FAE /* PolycodeFontEditor.cpp */,
 				6DCE865412AE146C00566FAE /* PolycodeFontEditor.cpp */,
@@ -364,6 +369,7 @@
 				6D91B3B512AF2B1D00261ED4 /* PolycodeTextEditor.cpp in Sources */,
 				6D91B3B512AF2B1D00261ED4 /* PolycodeTextEditor.cpp in Sources */,
 				6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */,
 				6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */,
 				6D8A55BC14B3EACB005F6411 /* PolycodeView.mm in Sources */,
 				6D8A55BC14B3EACB005F6411 /* PolycodeView.mm in Sources */,
+				6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};

+ 7 - 5
IDE/Build/Mac OS X/PolycodeAppDelegate.h

@@ -47,14 +47,16 @@ public:
 @property (assign) IBOutlet NSWindow *window;
 @property (assign) IBOutlet NSWindow *window;
 @property (assign) IBOutlet NSMenu *projectMenu;
 @property (assign) IBOutlet NSMenu *projectMenu;
 
 
+
 - (void) showProjectMenu;
 - (void) showProjectMenu;
 
 
 // Menu accessors
 // Menu accessors
 
 
--(void) newProject: (id) sender;
--(void) closeProject: (id) sender;
--(void) newFile: (id) sender;
--(void) openProject: (id) sender;
--(void) saveFile: (id) sender;
+-(IBAction) runProject: (id) sender;
+-(IBAction) newProject: (id) sender;
+-(IBAction) closeProject: (id) sender;
+-(IBAction) newFile: (id) sender;
+-(IBAction) openProject: (id) sender;
+-(IBAction) saveFile: (id) sender;
 
 
 @end
 @end

+ 19 - 5
IDE/Build/Mac OS X/PolycodeAppDelegate.m

@@ -60,24 +60,38 @@
 	mustShowProjectMenu = YES;	
 	mustShowProjectMenu = YES;	
 }
 }
 
 
+- (void)applicationWillTerminate:(NSNotification *)aNotification {
+	NSLog(@"STOPPING\n");
+	app->saveConfigFile();
+	app->core->Shutdown();
+}
+
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
+{
+	return YES;
+}
+
+-(IBAction) runProject: (id) sender {
+	app->runProject();
+}
 
 
--(void) newProject: (id) sender {
+-(IBAction) newProject: (id) sender {
 	app->newProject();
 	app->newProject();
 }
 }
 
 
--(void) newFile: (id) sender {
+-(IBAction) newFile: (id) sender {
 	app->newFile();
 	app->newFile();
 }
 }
 
 
--(void) openProject: (id) sender {
+-(IBAction) openProject: (id) sender {
 	app->openProject();
 	app->openProject();
 }
 }
 
 
--(void) closeProject: (id) sender {
+-(IBAction) closeProject: (id) sender {
 	app->closeProject();
 	app->closeProject();
 }
 }
 
 
--(void) saveFile: (id) sender {
+-(IBAction) saveFile: (id) sender {
 	app->saveFile();
 	app->saveFile();
 }
 }
 
 

+ 21 - 1
IDE/Contents/Include/NewFileWindow.h

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #pragma once
 #pragma once
 
 

+ 22 - 1
IDE/Contents/Include/NewProjectWindow.h

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #pragma once
 #pragma once
 
 
 #include "PolycodeGlobals.h"
 #include "PolycodeGlobals.h"

+ 22 - 1
IDE/Contents/Include/PolycodeEditor.h

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #pragma once
 #pragma once
 
 
 #include "Polycode.h"
 #include "Polycode.h"

+ 22 - 1
IDE/Contents/Include/PolycodeEditorManager.h

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #pragma once
 #pragma once
 
 
 #include "Polycode.h"
 #include "Polycode.h"

+ 21 - 1
IDE/Contents/Include/PolycodeFontEditor.h

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #pragma once
 #pragma once
 
 

+ 31 - 8
IDE/Contents/Include/PolycodeFrame.h

@@ -1,10 +1,23 @@
 /*
 /*
- *  PolycodeFrame.h
- *  Polycode
- *
- *  Created by Ivan Safrin on 11/29/10.
- *  Copyright 2010 Local Projects. All rights reserved.
- *
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
  */
  */
 
 
 #include "PolycodeUI.h"
 #include "PolycodeUI.h"
@@ -37,6 +50,11 @@ public:
 	NewProjectWindow *newProjectWindow;	
 	NewProjectWindow *newProjectWindow;	
 	NewFileWindow *newFileWindow;
 	NewFileWindow *newFileWindow;
 	
 	
+	ScreenEntity *welcomeEntity;	
+	PolycodeProjectBrowser *projectBrowser;
+		
+	UIImageButton *playButton;
+			
 private:
 private:
 	
 	
 	int frameSizeX;
 	int frameSizeX;
@@ -45,6 +63,9 @@ private:
 	ScreenShape *topBarBg;
 	ScreenShape *topBarBg;
 	ScreenImage *logo;	
 	ScreenImage *logo;	
 	ScreenImage *resizer;	
 	ScreenImage *resizer;	
+
+	
+	ScreenImage *welcomeImage;	
 	
 	
 	ScreenEntity *editorHolder;
 	ScreenEntity *editorHolder;
 	
 	
@@ -52,7 +73,9 @@ private:
 	vector<PolycodeEditor*> editors;
 	vector<PolycodeEditor*> editors;
 	
 	
 	ScreenShape *modalBlocker;
 	ScreenShape *modalBlocker;
-	UIWindow *modalChild;	
+	UIWindow *modalChild;		
+	
+	UIButton *newProjectButton;
+	UIButton *examplesButton;
 	
 	
-	PolycodeProjectBrowser *projectBrowser;
 };
 };

+ 22 - 1
IDE/Contents/Include/PolycodeGlobals.h

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #pragma once
 #pragma once
 
 
 #define RESOURCE_PATH ""
 #define RESOURCE_PATH ""

+ 25 - 8
IDE/Contents/Include/PolycodeIDEApp.h

@@ -1,12 +1,25 @@
 /*
 /*
- *  PolycodeIDEApp.h
- *  Polycode
- *
- *  Created by Ivan Safrin on 11/29/10.
- *  Copyright 2010 Local Projects. All rights reserved.
- *
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
  */
  */
-
+ 
 #import "PolycodeView.h"
 #import "PolycodeView.h"
 
 
 #include "PolycodeGlobals.h"
 #include "PolycodeGlobals.h"
@@ -21,6 +34,8 @@
 #include "PolycodeFontEditor.h"
 #include "PolycodeFontEditor.h"
 #include "PolycodeTextEditor.h"
 #include "PolycodeTextEditor.h"
 
 
+#include "PolycodeToolLauncher.h"
+
 using namespace Polycode;
 using namespace Polycode;
 
 
 class PolycodeIDEApp : public EventDispatcher {
 class PolycodeIDEApp : public EventDispatcher {
@@ -41,11 +56,13 @@ public:
 	void closeProject();	
 	void closeProject();	
 	void saveFile();
 	void saveFile();
 	
 	
+	void runProject();
+	
 	const static int EVENT_SHOW_MENU = 1;
 	const static int EVENT_SHOW_MENU = 1;
 	
 	
+	CocoaCore *core;	
 protected:	
 protected:	
 	PolycodeFrame *frame;
 	PolycodeFrame *frame;
-	CocoaCore *core;
 	
 	
 	PolycodeEditorManager *editorManager;
 	PolycodeEditorManager *editorManager;
 	PolycodeProjectManager *projectManager;
 	PolycodeProjectManager *projectManager;

+ 22 - 1
IDE/Contents/Include/PolycodeImageEditor.h

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #pragma once
 #pragma once
 
 
 #include "PolycodeEditor.h"
 #include "PolycodeEditor.h"

+ 21 - 1
IDE/Contents/Include/PolycodeProject.h

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #pragma once
 #pragma once
 
 

+ 22 - 1
IDE/Contents/Include/PolycodeProjectBrowser.h

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #pragma once 
 #pragma once 
 
 
 #include <Polycode.h>
 #include <Polycode.h>

+ 21 - 2
IDE/Contents/Include/PolycodeProjectManager.h

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #include "Polycode.h"
 #include "Polycode.h"
 #include "PolycodeGlobals.h"
 #include "PolycodeGlobals.h"
@@ -7,7 +27,6 @@
 
 
 #pragma once 
 #pragma once 
 
 
-
 using namespace Polycode;
 using namespace Polycode;
 
 
 class PolycodeProjectManager {
 class PolycodeProjectManager {

+ 21 - 1
IDE/Contents/Include/PolycodeTextEditor.h

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #pragma once
 #pragma once
 
 

+ 37 - 0
IDE/Contents/Include/PolycodeToolLauncher.h

@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
+#pragma once
+
+#include "PolycodeProject.h"
+
+class PolycodeToolLauncher {
+	public: 
+		PolycodeToolLauncher();
+		~PolycodeToolLauncher();
+		
+		static void execLocalBinCommand(String command);		
+		static String generateTempPath();
+		static void buildProject(PolycodeProject *project, String destinationPath);
+
+		static void runPolyapp(String polyappPath);
+};	

BIN
IDE/Contents/Resources/Images/barlogo.png


BIN
IDE/Contents/Resources/Images/play_button.png


BIN
IDE/Contents/Resources/Images/welcome.png


+ 7 - 16
IDE/Contents/Resources/ProjectTemplates/Basic/2D Project/template.polyproject

@@ -1,17 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<TauProject>
-	<entryPoint>/Source/Main.lua</entryPoint>
-	<backgroundColor red="0" green="0" blue="0"></backgroundColor>
-	<defaultWidth>640</defaultWidth>
-	<defaultHeight>480</defaultHeight>
-	<frameRate>60</frameRate>
-	<antiAliasingLevel>0</antiAliasingLevel>
-	<fullScreen>false</fullScreen>
-	<openDocuments>
-		<openDocument>Source/Main.lua</openDocument>
-	</openDocuments>
-	<expandedTreeItems>
-		<expandedTreeItem></expandedTreeItem>
-		<expandedTreeItem>Source</expandedTreeItem>
-	</expandedTreeItems>
-</TauProject>
+<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0">
+	<backgroundColor red="0.25" green="0.25" blue="0.25" />
+	<entryPoint>Source/Main.lua</entryPoint>
+	<packedItems>
+		<item path="Resources" type="folder"/>
+	</packedItems>        	
+</PolycodeProject>

+ 22 - 1
IDE/Contents/Source/NewFileWindow.cpp

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #include "NewFileWindow.h"
 #include "NewFileWindow.h"
 
 
 NewFileWindow::NewFileWindow() : UIWindow(L"Create New File", 500, 300) {
 NewFileWindow::NewFileWindow() : UIWindow(L"Create New File", 500, 300) {

+ 21 - 1
IDE/Contents/Source/NewProjectWindow.cpp

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
 
 
 #include "NewProjectWindow.h"
 #include "NewProjectWindow.h"
 
 

+ 21 - 1
IDE/Contents/Source/PolycodeEditor.cpp

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #include "PolycodeEditor.h"
 #include "PolycodeEditor.h"
 
 

+ 22 - 1
IDE/Contents/Source/PolycodeEditorManager.cpp

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #include "PolycodeEditorManager.h"
 #include "PolycodeEditorManager.h"
 
 
 
 

+ 21 - 1
IDE/Contents/Source/PolycodeFontEditor.cpp

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #include "PolycodeFontEditor.h"
 #include "PolycodeFontEditor.h"
 
 

+ 56 - 11
IDE/Contents/Source/PolycodeFrame.cpp

@@ -1,11 +1,24 @@
 /*
 /*
- *  PolycodeFrame.cpp
- *  Polycode
- *
- *  Created by Ivan Safrin on 11/29/10.
- *  Copyright 2010 Local Projects. All rights reserved.
- *
- */
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
 
 
 #include "PolycodeFrame.h"
 #include "PolycodeFrame.h"
 
 
@@ -13,9 +26,25 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 
 
 	modalChild = NULL;
 	modalChild = NULL;
 	
 	
+	welcomeEntity = new ScreenEntity();
+	addChild(welcomeEntity);
+	welcomeImage = new ScreenImage("welcome.png");
+	welcomeEntity->addChild(welcomeImage);
+	welcomeEntity->snapToPixels = true;
+	
+	newProjectButton = new UIButton("Create A New Project!", 220);	
+	newProjectButton->setPosition(230,80);
+	newProjectButton->addEventListener(this, UIEvent::CLICK_EVENT);
+	
+	examplesButton = new UIButton("Open An Example Project", 220);	
+	examplesButton->setPosition(460,80);
+	
+	welcomeEntity->addChild(newProjectButton);
+	welcomeEntity->addChild(examplesButton);
+	
 	editorHolder = new ScreenEntity();
 	editorHolder = new ScreenEntity();
 	addChild(editorHolder);
 	addChild(editorHolder);
-	
+		
 	
 	
 	projectBrowser = new PolycodeProjectBrowser();
 	projectBrowser = new PolycodeProjectBrowser();
 	addChild(projectBrowser);
 	addChild(projectBrowser);
@@ -25,10 +54,15 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	topBarBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
 	topBarBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
 	addChild(topBarBg);
 	addChild(topBarBg);
 	
 	
-	logo = new ScreenImage("Images/barlogo.png");	
+	logo = new ScreenImage("barlogo.png");	
 	addChild(logo);		
 	addChild(logo);		
 	
 	
-	resizer = new ScreenImage("Images/corner_resize.png");	
+	
+	playButton = new UIImageButton("play_button.png");
+	addChild(playButton);
+	playButton->setPosition(10,8);
+	
+	resizer = new ScreenImage("corner_resize.png");	
 	addChild(resizer);
 	addChild(resizer);
 	resizer->setColor(0,0,0,0.4);
 	resizer->setColor(0,0,0,0.4);
 	
 	
@@ -94,6 +128,13 @@ void PolycodeFrame::handleEvent(Event *event) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CLOSE_EVENT) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CLOSE_EVENT) {
 			hideModal();
 			hideModal();
 		}
 		}
+	} else {
+		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CLICK_EVENT && event->getDispatcher() == newProjectButton) {
+
+			newProjectWindow->ResetForm();
+			showModal(newProjectWindow);
+
+		}	
 	}
 	}
 }
 }
 
 
@@ -102,10 +143,14 @@ void PolycodeFrame::Resize(int x, int y) {
 	frameSizeX = x;
 	frameSizeX = x;
 	frameSizeY = y;
 	frameSizeY = y;
 	
 	
+	welcomeEntity->setPosition((x-welcomeImage->getWidth()) / 2,
+		(y-welcomeImage->getHeight()) / 2); 
+	
 	topBarBg->setShapeSize(x, 45);
 	topBarBg->setShapeSize(x, 45);
-	logo->setPosition(x-logo->getWidth()-10, 6);	
+	logo->setPosition(x-logo->getWidth()-2, 2);	
 	resizer->setPosition(x-resizer->getWidth()-1, y-resizer->getHeight()-1);	
 	resizer->setPosition(x-resizer->getWidth()-1, y-resizer->getHeight()-1);	
 	projectBrowser->Resize(200, y-45);
 	projectBrowser->Resize(200, y-45);
+	
 	modalBlocker->setShapeSize(x, y);
 	modalBlocker->setShapeSize(x, y);
 	
 	
 	editorHolder->setPosition(200, 45);
 	editorHolder->setPosition(200, 45);

+ 50 - 11
IDE/Contents/Source/PolycodeIDEApp.cpp

@@ -1,12 +1,24 @@
 /*
 /*
- *  PolycodeIDEApp.cpp
- *  Polycode
- *
- *  Created by Ivan Safrin on 11/29/10.
- *  Copyright 2010 Local Projects. All rights reserved.
- *
- */
-
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
 
 
 #include "PolycodeIDEApp.h"
 #include "PolycodeIDEApp.h"
 
 
@@ -43,6 +55,7 @@ PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
 	frame->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
 	frame->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
 	
 	
 	frame->newProjectWindow->addEventListener(this, UIEvent::OK_EVENT);
 	frame->newProjectWindow->addEventListener(this, UIEvent::OK_EVENT);
+	frame->playButton->addEventListener(this, UIEvent::CLICK_EVENT);
 	
 	
 	screen->addChild(frame);
 	screen->addChild(frame);
 	
 	
@@ -94,10 +107,21 @@ void PolycodeIDEApp::openProject() {
 	std::vector<String> paths = core->openFilePicker(extensions, false);
 	std::vector<String> paths = core->openFilePicker(extensions, false);
 	if(paths[0] != "") {
 	if(paths[0] != "") {
 		PolycodeProject *project = projectManager->openProject(paths[0]);
 		PolycodeProject *project = projectManager->openProject(paths[0]);
-		projectManager->setActiveProject(project);
+		if(project) {
+			projectManager->setActiveProject(project);
+		}
 	}		
 	}		
 }
 }
 
 
+void PolycodeIDEApp::runProject() {
+	if(projectManager->getActiveProject()) {
+		String outPath = PolycodeToolLauncher::generateTempPath() + ".polyapp";
+		PolycodeToolLauncher::buildProject(projectManager->getActiveProject(), outPath);
+		PolycodeToolLauncher::runPolyapp(outPath);
+		core->removeDiskItem(outPath);
+	}
+}
+
 void PolycodeIDEApp::saveFile() {
 void PolycodeIDEApp::saveFile() {
 	editorManager->getCurrentEditor()->saveFile();
 	editorManager->getCurrentEditor()->saveFile();
 }
 }
@@ -152,8 +176,14 @@ void PolycodeIDEApp::handleEvent(Event *event) {
 				
 				
 			}
 			}
 		}
 		}
-	}	
-
+	}
+	
+	if(event->getDispatcher() == frame->playButton) {	
+		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CLICK_EVENT) {
+			runProject();
+		}
+	}
+	
 	if(event->getDispatcher() == frame->newProjectWindow) {
 	if(event->getDispatcher() == frame->newProjectWindow) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
 			projectManager->createNewProject(frame->newProjectWindow->getTemplateFolder(), frame->newProjectWindow->getProjectName(), frame->newProjectWindow->getProjectLocation());
 			projectManager->createNewProject(frame->newProjectWindow->getTemplateFolder(), frame->newProjectWindow->getProjectName(), frame->newProjectWindow->getProjectLocation());
@@ -202,6 +232,15 @@ PolycodeIDEApp::~PolycodeIDEApp() {
 }
 }
 
 
 bool PolycodeIDEApp::Update() {
 bool PolycodeIDEApp::Update() {
+
+	if(projectManager->getProjectCount() > 0) {
+		frame->welcomeEntity->visible =  false;
+		frame->projectBrowser->visible =  true;		
+	} else {
+		frame->welcomeEntity->visible =  true;
+		frame->projectBrowser->visible =  false;			
+	}
+
 	return core->Update();
 	return core->Update();
 }
 }
 
 

+ 22 - 1
IDE/Contents/Source/PolycodeImageEditor.cpp

@@ -1,4 +1,25 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
 #include "PolycodeImageEditor.h"
 #include "PolycodeImageEditor.h"
 
 
 PolycodeImageEditor::PolycodeImageEditor() : PolycodeEditor(true){
 PolycodeImageEditor::PolycodeImageEditor() : PolycodeEditor(true){

+ 21 - 0
IDE/Contents/Source/PolycodeProject.cpp

@@ -1,3 +1,24 @@
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
 
 
 #include "PolycodeProject.h"
 #include "PolycodeProject.h"
 
 

+ 21 - 1
IDE/Contents/Source/PolycodeProjectBrowser.cpp

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
 
 
 #include "PolycodeProjectBrowser.h"
 #include "PolycodeProjectBrowser.h"
 
 

+ 27 - 1
IDE/Contents/Source/PolycodeProjectManager.cpp

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
 
 
 #include "PolycodeProjectManager.h"
 #include "PolycodeProjectManager.h"
 
 
@@ -14,6 +34,12 @@ PolycodeProjectManager::~PolycodeProjectManager() {
 PolycodeProject* PolycodeProjectManager::openProject(String path) {
 PolycodeProject* PolycodeProjectManager::openProject(String path) {
 	printf("Opening project  %s\n", path.c_str());
 	printf("Opening project  %s\n", path.c_str());
 	
 	
+	FILE *f = fopen(path.c_str(), "r");
+	if(!f) {
+		return NULL;
+	}
+	fclose(f);
+	
 	vector<String> bits = path.split("/.");
 	vector<String> bits = path.split("/.");
 	
 	
 	String projectPath = "";
 	String projectPath = "";

+ 21 - 1
IDE/Contents/Source/PolycodeTextEditor.cpp

@@ -1,4 +1,24 @@
-
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
 
 
 #include "PolycodeTextEditor.h"
 #include "PolycodeTextEditor.h"
 
 

+ 57 - 0
IDE/Contents/Source/PolycodeToolLauncher.cpp

@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
+#pragma once
+
+#include "PolycodeToolLauncher.h"
+
+PolycodeToolLauncher::PolycodeToolLauncher() {
+
+}
+
+PolycodeToolLauncher::~PolycodeToolLauncher() {
+
+}
+
+void PolycodeToolLauncher::execLocalBinCommand(String command) {
+	system(command.c_str());
+}
+
+String PolycodeToolLauncher::generateTempPath() {
+	return "/tmp/"+String::IntToString(rand() % 10000000);
+}
+
+void PolycodeToolLauncher::buildProject(PolycodeProject *project, String destinationPath) {
+	String projectBasePath = project->getRootFolder();
+	String projectPath = project->getProjectFile();
+	
+	String polycodeBasePath = CoreServices::getInstance()->getCore()->getDefaultWorkingDirectory();
+	
+	execLocalBinCommand("cd "+projectBasePath+" && "+polycodeBasePath+"/Standalone/Bin/polybuild  --config="+projectPath+" --out="+destinationPath);
+
+}
+
+void PolycodeToolLauncher::runPolyapp(String polyappPath) {
+	String polycodeBasePath = CoreServices::getInstance()->getCore()->getDefaultWorkingDirectory();
+
+	execLocalBinCommand("cd "+polycodeBasePath+"/Standalone/Player/PolycodePlayer.app/Contents/Resources && ../MacOS/PolycodePlayer "+polyappPath);	
+}