Просмотр исходного кода

Started working on new file dialog, started working on build tool

Ivan Safrin 15 лет назад
Родитель
Сommit
e702ba12fa

+ 2 - 0
.gitignore

@@ -12,6 +12,8 @@
 Core/Build/Mac\ OS\ X/build
 IDE/Build/Mac\ OS\ X/build
 Modules/Build/Mac\ OS\ X/build
+Tools/Build/Mac\ OS\ X/build
+Player/Build/Mac\ OS\ X/build
 Core/Dependencies
 
 # OS generated files #

+ 140 - 137
IDE/Build/Mac OS X/English.lproj/MainMenu.xib

@@ -187,42 +187,19 @@
 							<string key="NSTitle">File</string>
 							<object class="NSMutableArray" key="NSMenuItems">
 								<bool key="EncodedWithXMLCoder">YES</bool>
-								<object class="NSMenuItem" id="428664341">
+								<object class="NSMenuItem" id="912428392">
 									<reference key="NSMenu" ref="720053764"/>
-									<string key="NSTitle">New File</string>
-									<string key="NSKeyEquiv"/>
+									<string key="NSTitle">New Project</string>
+									<string key="NSKeyEquiv">N</string>
+									<int key="NSKeyEquivModMask">1048576</int>
 									<int key="NSMnemonicLoc">2147483647</int>
 									<reference key="NSOnImage" ref="35465992"/>
 									<reference key="NSMixedImage" ref="502551668"/>
-									<string key="NSAction">submenuAction:</string>
-									<object class="NSMenu" key="NSSubmenu" id="629050378">
-										<string key="NSTitle">New File</string>
-										<object class="NSMutableArray" key="NSMenuItems">
-											<bool key="EncodedWithXMLCoder">YES</bool>
-											<object class="NSMenuItem" id="705341025">
-												<reference key="NSMenu" ref="629050378"/>
-												<string key="NSTitle">Source File</string>
-												<string key="NSKeyEquiv">n</string>
-												<int key="NSKeyEquivModMask">1048576</int>
-												<int key="NSMnemonicLoc">2147483647</int>
-												<reference key="NSOnImage" ref="35465992"/>
-												<reference key="NSMixedImage" ref="502551668"/>
-											</object>
-											<object class="NSMenuItem" id="918135976">
-												<reference key="NSMenu" ref="629050378"/>
-												<string key="NSTitle">Material Library</string>
-												<string key="NSKeyEquiv"/>
-												<int key="NSMnemonicLoc">2147483647</int>
-												<reference key="NSOnImage" ref="35465992"/>
-												<reference key="NSMixedImage" ref="502551668"/>
-											</object>
-										</object>
-									</object>
 								</object>
-								<object class="NSMenuItem" id="912428392">
+								<object class="NSMenuItem" id="164447311">
 									<reference key="NSMenu" ref="720053764"/>
-									<string key="NSTitle">New Project</string>
-									<string key="NSKeyEquiv">N</string>
+									<string key="NSTitle">New File</string>
+									<string key="NSKeyEquiv">n</string>
 									<int key="NSKeyEquivModMask">1048576</int>
 									<int key="NSMnemonicLoc">2147483647</int>
 									<reference key="NSOnImage" ref="35465992"/>
@@ -484,6 +461,57 @@
 							</object>
 						</object>
 					</object>
+					<object class="NSMenuItem" id="947553395">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">Project</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="856973215">
+							<string key="NSTitle">Project</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="193606301">
+									<reference key="NSMenu" ref="856973215"/>
+									<string key="NSTitle">Run Project</string>
+									<string key="NSKeyEquiv">r</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="656074920">
+									<reference key="NSMenu" ref="856973215"/>
+									<string key="NSTitle">Package and Export</string>
+									<string key="NSKeyEquiv">E</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="158605591">
+									<reference key="NSMenu" ref="856973215"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="430821737">
+									<reference key="NSMenu" ref="856973215"/>
+									<string key="NSTitle">Project Settings</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+							</object>
+						</object>
+					</object>
 					<object class="NSMenuItem" id="713487014">
 						<reference key="NSMenu" ref="649796088"/>
 						<string key="NSTitle">Window</string>
@@ -753,14 +781,6 @@
 					</object>
 					<int key="connectionID">370</int>
 				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBActionConnection" key="connection">
-						<string key="label">newDocument:</string>
-						<reference key="source" ref="1014"/>
-						<reference key="destination" ref="705341025"/>
-					</object>
-					<int key="connectionID">373</int>
-				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBActionConnection" key="connection">
 						<string key="label">terminate:</string>
@@ -849,6 +869,14 @@
 					</object>
 					<int key="connectionID">550</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">newFile:</string>
+						<reference key="source" ref="976324537"/>
+						<reference key="destination" ref="164447311"/>
+					</object>
+					<int key="connectionID">558</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -889,6 +917,7 @@
 							<reference ref="952259628"/>
 							<reference ref="379814623"/>
 							<reference ref="448692316"/>
+							<reference ref="947553395"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -938,12 +967,12 @@
 							<reference ref="722745758"/>
 							<reference ref="776162233"/>
 							<reference ref="912428392"/>
-							<reference ref="428664341"/>
 							<reference ref="1037276792"/>
 							<reference ref="425164168"/>
 							<reference ref="1010469920"/>
 							<reference ref="268409637"/>
 							<reference ref="463542598"/>
+							<reference ref="164447311"/>
 						</object>
 						<reference key="parent" ref="379814623"/>
 					</object>
@@ -1253,40 +1282,11 @@
 						<reference key="object" ref="912428392"/>
 						<reference key="parent" ref="720053764"/>
 					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">539</int>
-						<reference key="object" ref="428664341"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="629050378"/>
-						</object>
-						<reference key="parent" ref="720053764"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">540</int>
-						<reference key="object" ref="629050378"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="705341025"/>
-							<reference ref="918135976"/>
-						</object>
-						<reference key="parent" ref="428664341"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">82</int>
-						<reference key="object" ref="705341025"/>
-						<reference key="parent" ref="629050378"/>
-					</object>
 					<object class="IBObjectRecord">
 						<int key="objectID">79</int>
 						<reference key="object" ref="425164168"/>
 						<reference key="parent" ref="720053764"/>
 					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">542</int>
-						<reference key="object" ref="918135976"/>
-						<reference key="parent" ref="629050378"/>
-					</object>
 					<object class="IBObjectRecord">
 						<int key="objectID">544</int>
 						<reference key="object" ref="1037276792"/>
@@ -1307,6 +1307,52 @@
 						<reference key="object" ref="463542598"/>
 						<reference key="parent" ref="720053764"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">551</int>
+						<reference key="object" ref="164447311"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">552</int>
+						<reference key="object" ref="947553395"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="856973215"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">553</int>
+						<reference key="object" ref="856973215"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="193606301"/>
+							<reference ref="430821737"/>
+							<reference ref="656074920"/>
+							<reference ref="158605591"/>
+						</object>
+						<reference key="parent" ref="947553395"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">554</int>
+						<reference key="object" ref="193606301"/>
+						<reference key="parent" ref="856973215"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">555</int>
+						<reference key="object" ref="430821737"/>
+						<reference key="parent" ref="856973215"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">556</int>
+						<reference key="object" ref="656074920"/>
+						<reference key="parent" ref="856973215"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">557</int>
+						<reference key="object" ref="158605591"/>
+						<reference key="parent" ref="856973215"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -1410,16 +1456,20 @@
 					<string>533.IBPluginDependency</string>
 					<string>533.IBViewBoundsToFrameTransform</string>
 					<string>538.IBPluginDependency</string>
-					<string>539.IBPluginDependency</string>
-					<string>540.IBEditorWindowLastContentRect</string>
-					<string>540.IBPluginDependency</string>
-					<string>542.IBPluginDependency</string>
 					<string>544.IBPluginDependency</string>
 					<string>545.IBPluginDependency</string>
 					<string>545.ImportedFromIB2</string>
 					<string>546.IBPluginDependency</string>
 					<string>546.ImportedFromIB2</string>
 					<string>547.IBPluginDependency</string>
+					<string>551.IBPluginDependency</string>
+					<string>552.IBPluginDependency</string>
+					<string>553.IBEditorWindowLastContentRect</string>
+					<string>553.IBPluginDependency</string>
+					<string>554.IBPluginDependency</string>
+					<string>555.IBPluginDependency</string>
+					<string>556.IBPluginDependency</string>
+					<string>557.IBPluginDependency</string>
 					<string>56.IBPluginDependency</string>
 					<string>56.ImportedFromIB2</string>
 					<string>57.IBEditorWindowLastContentRect</string>
@@ -1442,8 +1492,6 @@
 					<string>81.IBPluginDependency</string>
 					<string>81.ImportedFromIB2</string>
 					<string>81.editorWindowContentRectSynchronizationRect</string>
-					<string>82.IBPluginDependency</string>
-					<string>82.ImportedFromIB2</string>
 					<string>83.IBPluginDependency</string>
 					<string>83.ImportedFromIB2</string>
 					<string>92.IBPluginDependency</string>
@@ -1522,11 +1570,11 @@
 					<integer value="1"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
-					<string>{{561, 763}, {194, 73}}</string>
+					<string>{{626, 763}, {194, 73}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>{{525, 802}, {197, 73}}</string>
-					<string>{{380, 836}, {313, 20}}</string>
+					<string>{{380, 836}, {378, 20}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>{74, 862}</string>
@@ -1539,7 +1587,7 @@
 					<string>{3.40282e+38, 3.40282e+38}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{682, 813}, {167, 23}}</string>
+					<string>{{697, 813}, {167, 23}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1549,14 +1597,18 @@
 					<object class="NSAffineTransform"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{683, 793}, {182, 43}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{561, 763}, {222, 73}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<integer value="1"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<integer value="1"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
@@ -1584,8 +1636,6 @@
 					<integer value="1"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
-					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<integer value="1"/>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -1604,7 +1654,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">550</int>
+			<int key="maxID">558</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1616,6 +1666,7 @@
 						<bool key="EncodedWithXMLCoder">YES</bool>
 						<object class="NSArray" key="dict.sortedKeys">
 							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>newFile:</string>
 							<string>newProject:</string>
 							<string>openProject:</string>
 							<string>saveFile:</string>
@@ -1625,18 +1676,24 @@
 							<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>newFile:</string>
 							<string>newProject:</string>
 							<string>openProject:</string>
 							<string>saveFile:</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
+							<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>
@@ -1833,60 +1890,6 @@
 						<string key="minorKey">AppKit.framework/Headers/NSDocumentScripting.h</string>
 					</object>
 				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSDocumentController</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>clearRecentDocuments:</string>
-							<string>newDocument:</string>
-							<string>openDocument:</string>
-							<string>saveAllDocuments:</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>
-						</object>
-					</object>
-					<object class="NSMutableDictionary" key="actionInfosByName">
-						<bool key="EncodedWithXMLCoder">YES</bool>
-						<object class="NSArray" key="dict.sortedKeys">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>clearRecentDocuments:</string>
-							<string>newDocument:</string>
-							<string>openDocument:</string>
-							<string>saveAllDocuments:</string>
-						</object>
-						<object class="NSMutableArray" key="dict.values">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBActionInfo">
-								<string key="name">clearRecentDocuments:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">newDocument:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">openDocument:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">saveAllDocuments:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">AppKit.framework/Headers/NSDocumentController.h</string>
-					</object>
-				</object>
 				<object class="IBPartialClassDescription">
 					<string key="className">NSFontManager</string>
 					<string key="superclassName">NSObject</string>

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

@@ -12,6 +12,7 @@
 		6D43F54112AB3E5C001E6D87 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D43F53F12AB3E5C001E6D87 /* libz.a */; };
 		6D43F54212AB3E5C001E6D87 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D43F54012AB3E5C001E6D87 /* libpng.a */; };
 		6D43F55E12AB3E9E001E6D87 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D43F55D12AB3E9E001E6D87 /* libfreetype.a */; };
+		6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */; };
 		6D80E91E12AB53FB0037A708 /* PolycodeFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91912AB53FB0037A708 /* PolycodeFrame.cpp */; };
 		6D80E91F12AB53FB0037A708 /* PolycodeIDEApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91A12AB53FB0037A708 /* PolycodeIDEApp.cpp */; };
 		6D80E92012AB53FB0037A708 /* PolycodeProject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91B12AB53FB0037A708 /* PolycodeProject.cpp */; };
@@ -59,6 +60,8 @@
 		6D43F53F12AB3E5C001E6D87 /* libz.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libz.a; path = ../../../Core/Dependencies/zlib/libz.a; sourceTree = SOURCE_ROOT; };
 		6D43F54012AB3E5C001E6D87 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = ../../../Core/Dependencies/libpng/libpng.a; sourceTree = SOURCE_ROOT; };
 		6D43F55D12AB3E9E001E6D87 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../../../Core/Dependencies/freetype/libfreetype.a; sourceTree = SOURCE_ROOT; };
+		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>"; };
 		6D80E91312AB53FB0037A708 /* PolycodeFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeFrame.h; sourceTree = "<group>"; };
 		6D80E91412AB53FB0037A708 /* PolycodeIDEApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeIDEApp.h; sourceTree = "<group>"; };
 		6D80E91512AB53FB0037A708 /* PolycodeProject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeProject.h; sourceTree = "<group>"; };
@@ -200,6 +203,7 @@
 		6D80E91212AB53FB0037A708 /* Include */ = {
 			isa = PBXGroup;
 			children = (
+				6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */,
 				6D91B3B312AF2B1600261ED4 /* PolycodeTextEditor.h */,
 				6DCE865312AE146600566FAE /* PolycodeFontEditor.h */,
 				6DCE85B512AE082300566FAE /* PolycodeImageEditor.h */,
@@ -220,6 +224,7 @@
 		6D80E91812AB53FB0037A708 /* Source */ = {
 			isa = PBXGroup;
 			children = (
+				6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */,
 				6D91B3B412AF2B1D00261ED4 /* PolycodeTextEditor.cpp */,
 				6DCE865412AE146C00566FAE /* PolycodeFontEditor.cpp */,
 				6DCE85B612AE082B00566FAE /* PolycodeImageEditor.cpp */,
@@ -330,6 +335,7 @@
 				6DCE85B712AE082B00566FAE /* PolycodeImageEditor.cpp in Sources */,
 				6DCE865512AE146C00566FAE /* PolycodeFontEditor.cpp in Sources */,
 				6D91B3B512AF2B1D00261ED4 /* PolycodeTextEditor.cpp in Sources */,
+				6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 1 - 0
IDE/Build/Mac OS X/PolycodeAppDelegate.h

@@ -25,6 +25,7 @@
 // Menu accessors
 
 -(void) newProject: (id) sender;
+-(void) newFile: (id) sender;
 -(void) openProject: (id) sender;
 -(void) saveFile: (id) sender;
 

+ 4 - 0
IDE/Build/Mac OS X/PolycodeAppDelegate.m

@@ -38,6 +38,10 @@
 	app->newProject();
 }
 
+-(void) newFile: (id) sender {
+	app->newFile();
+}
+
 -(void) openProject: (id) sender {
 	app->openProject();
 }

+ 30 - 0
IDE/Contents/Include/NewFileWindow.h

@@ -0,0 +1,30 @@
+
+
+#pragma once
+
+#include "PolycodeGlobals.h"
+#include "PolycodeUI.h"
+#include "Polycode.h"
+
+using namespace Polycode;
+
+class FileTemplateUserData  {
+public:
+	String templateFolder;
+	int type;
+};
+
+class NewFileWindow : public UIWindow {
+	public:
+		NewFileWindow();
+		~NewFileWindow();
+	
+		void resetForm();
+		void parseTemplatesIntoTree(UITree *tree, OSFileEntry folder);
+
+	
+	protected:
+	
+		UITreeContainer *templateContainer;	
+		UITree *defaultTemplateTree;
+};

+ 2 - 0
IDE/Contents/Include/PolycodeFrame.h

@@ -12,6 +12,7 @@
 #include "PolycodeProjectBrowser.h"
 #include "PolycodeEditor.h"
 #include "NewProjectWindow.h"
+#include "NewFileWindow.h"
 
 using namespace Polycode;
 
@@ -34,6 +35,7 @@ public:
 	PolycodeProjectBrowser *getProjectBrowser();
 	
 	NewProjectWindow *newProjectWindow;	
+	NewFileWindow *newFileWindow;
 	
 private:
 	

+ 1 - 0
IDE/Contents/Include/PolycodeIDEApp.h

@@ -33,6 +33,7 @@ public:
 	
 	// menu commands
 	void newProject();
+	void newFile();	
 	void openProject();
 	void saveFile();
 	

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

@@ -11,6 +11,7 @@ using namespace Polycode;
 class BrowserUserData  {
 public:
 	OSFileEntry fileEntry;
+	int type;
 };
 
 

+ 6 - 1
IDE/Contents/Include/PolycodeProjectManager.h

@@ -16,11 +16,16 @@ class PolycodeProjectManager {
 		~PolycodeProjectManager();
 	
 	void createNewProject(String templateFolder, String projectName, String projectLocation);
-	void openProject(String path);
+	PolycodeProject* openProject(String path);
 	void setProjectBrowser(PolycodeProjectBrowser *projectBrowser) { this->projectBrowser = projectBrowser; }
 	
+	PolycodeProject* getActiveProject() { return activeProject; }
+	void setActiveProject(PolycodeProject* project) { activeProject = project; }
+	
 protected:
 	
+	PolycodeProject* activeProject;
+	
 	PolycodeProjectBrowser *projectBrowser;
 	vector<PolycodeProject*> projects;
 	

+ 0 - 0
IDE/Contents/Resources/FileTemplates/Basic/LUA Source File.lua


+ 7 - 0
IDE/Contents/Resources/FileTemplates/Materials and Shaders/Material Library.mat

@@ -0,0 +1,7 @@
+<?xml version="1.0" ?>
+<polycode_material_library>
+	<shaders>
+	</shaders>
+	<materials>
+	</materials>
+</polycode_material_library>

+ 58 - 0
IDE/Contents/Source/NewFileWindow.cpp

@@ -0,0 +1,58 @@
+
+#include "NewFileWindow.h"
+
+NewFileWindow::NewFileWindow() : UIWindow(L"Create New File", 500, 300) {
+	defaultTemplateTree = NULL;
+	
+	templateContainer = new UITreeContainer("boxIcon.png", L"File Templates", 200, 300-topPadding-padding-padding);	
+	
+	FileTemplateUserData *data = new FileTemplateUserData();
+	data->type = 0;
+	templateContainer->getRootNode()->setUserData(data);			
+
+	addChild(templateContainer);		
+	templateContainer->setPosition(padding,topPadding+padding);	
+	templateContainer->getRootNode()->toggleCollapsed();
+	
+	templateContainer->getRootNode()->addEventListener(this, UITreeEvent::SELECTED_EVENT);
+	
+	
+	vector<OSFileEntry> templates = OSBasics::parseFolder(RESOURCE_PATH"FileTemplates", false);
+	for(int i=0; i < templates.size(); i++) {
+		OSFileEntry entry = templates[i];
+		if(entry.type == OSFileEntry::TYPE_FOLDER) {
+			UITree *newChild = templateContainer->getRootNode()->addTreeChild("folder.png", entry.name, NULL);			
+			FileTemplateUserData *data = new FileTemplateUserData();
+			data->type = 0;
+			newChild->setUserData(data);			
+			newChild->toggleCollapsed();
+			parseTemplatesIntoTree(newChild, entry);
+		}
+	}	
+}
+
+NewFileWindow::~NewFileWindow() {
+	
+}
+
+void NewFileWindow::resetForm() {
+	defaultTemplateTree->setSelected();
+}
+
+void NewFileWindow::parseTemplatesIntoTree(UITree *tree, OSFileEntry folder) {
+	vector<OSFileEntry> templates = OSBasics::parseFolder(folder.fullPath, false);
+	for(int i=0; i < templates.size(); i++) {
+		OSFileEntry entry = templates[i];
+		if(entry.type != OSFileEntry::TYPE_FOLDER) {
+			UITree *newChild = tree->addTreeChild("templateIcon.png", entry.nameWithoutExtension, NULL);			
+			FileTemplateUserData *data = new FileTemplateUserData();
+			data->type = 1;
+			data->templateFolder = entry.fullPath;
+			newChild->setUserData(data);
+			if(entry.name == "LUA Source File.lua") {
+				defaultTemplateTree = newChild;
+				newChild->setSelected();
+			}
+		}
+	}	
+}

+ 3 - 0
IDE/Contents/Source/PolycodeFrame.cpp

@@ -42,6 +42,9 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	newProjectWindow = new NewProjectWindow();
 	newProjectWindow->visible = false;
 	
+	newFileWindow = new NewFileWindow();
+	newFileWindow->visible = false;
+	
 	currentEditor = NULL;
 	
 }

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

@@ -57,6 +57,14 @@ PolycodeIDEApp::PolycodeIDEApp(SubstanceView *view) : EventHandler() {
 void PolycodeIDEApp::newProject() {
 	frame->newProjectWindow->ResetForm();
 	frame->showModal(frame->newProjectWindow);
+	
+}
+
+void PolycodeIDEApp::newFile() {
+	if(projectManager->getActiveProject()) {
+		frame->newFileWindow->resetForm();
+		frame->showModal(frame->newFileWindow);
+	}
 }
 
 void PolycodeIDEApp::openProject() {
@@ -68,8 +76,9 @@ void PolycodeIDEApp::openProject() {
 	extensions.push_back(ext);
 	vector<string> paths = core->openFilePicker(extensions, false);
 	if(paths[0] != "") {
-		projectManager->openProject(paths[0]);
-	}
+		PolycodeProject *project = projectManager->openProject(paths[0]);
+		projectManager->setActiveProject(project);
+	}		
 }
 
 void PolycodeIDEApp::saveFile() {

+ 15 - 2
IDE/Contents/Source/PolycodeProjectBrowser.cpp

@@ -7,6 +7,10 @@ PolycodeProjectBrowser::PolycodeProjectBrowser() : ScreenEntity() {
 	treeContainer->getRootNode()->toggleCollapsed();
 	treeContainer->getRootNode()->addEventListener(this, UITreeEvent::SELECTED_EVENT);
 	
+	BrowserUserData *data = new BrowserUserData();
+	data->type = 0;
+	treeContainer->getRootNode()->setUserData((void*) data)	;
+	
 	addChild(treeContainer);		
 	treeContainer->setPosition(0,45);	
 	
@@ -21,14 +25,21 @@ void PolycodeProjectBrowser::addProject(PolycodeProject *project) {
 	UITree *projectTree = treeContainer->getRootNode()->addTreeChild("projectIcon.png", project->getProjectName(), (void*) project);
 	projectTree->toggleCollapsed();
 	
+	BrowserUserData *data = new BrowserUserData();
+	data->type = 0;
+	projectTree->setUserData((void*) data)	;
+	
 	parseFolderIntoNode(projectTree, project->getRootFolder());	
 }
 
 void PolycodeProjectBrowser::handleEvent(Event *event) {
 	if(event->getDispatcher() == treeContainer->getRootNode()) {
 		if(event->getEventCode() == UITreeEvent::SELECTED_EVENT){ 
-			selectedData =  (BrowserUserData *)treeContainer->getRootNode()->getSelectedNode()->getUserData();
-			dispatchEvent(new Event(), Event::CHANGE_EVENT);
+			BrowserUserData *data = (BrowserUserData *)treeContainer->getRootNode()->getSelectedNode()->getUserData();
+			if(data->type != 0) {
+				selectedData =  data;
+				dispatchEvent(new Event(), Event::CHANGE_EVENT);
+			}
 		}
 	}
 	
@@ -44,10 +55,12 @@ void PolycodeProjectBrowser::parseFolderIntoNode(UITree *node, String spath) {
 			BrowserUserData *data = new BrowserUserData();
 			data->fileEntry = entry;
 			UITree *newChild = node->addTreeChild("folder.png", entry.name, (void*) data);
+			data->type = 2;			
 			parseFolderIntoNode(newChild, entry.fullPath);
 		} else {
 			BrowserUserData *data = new BrowserUserData();
 			data->fileEntry = entry;
+			data->type = 1;
 			UITree *newChild = node->addTreeChild("file.png", entry.name, (void*) data);			
 		}
 	}	

+ 3 - 3
IDE/Contents/Source/PolycodeProjectManager.cpp

@@ -3,7 +3,7 @@
 #include "PolycodeProjectManager.h"
 
 PolycodeProjectManager::PolycodeProjectManager() {
-	
+	activeProject = NULL;
 }
 
 PolycodeProjectManager::~PolycodeProjectManager() {
@@ -11,7 +11,7 @@ PolycodeProjectManager::~PolycodeProjectManager() {
 }
 
 
-void PolycodeProjectManager::openProject(String path) {
+PolycodeProject* PolycodeProjectManager::openProject(String path) {
 	printf("Opening project  %s\n", path.c_str());
 	
 	vector<String> bits = path.split("/.");
@@ -27,7 +27,7 @@ void PolycodeProjectManager::openProject(String path) {
 	projects.push_back(newProject);
 	
 	projectBrowser->addProject(newProject);
-	
+	return newProject;
 }
 
 void PolycodeProjectManager::createNewProject(String templateFolder, String projectName, String projectLocation) {	

+ 202 - 0
Tools/Build/Mac OS X/Tools.xcodeproj/project.pbxproj

@@ -0,0 +1,202 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 42;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		6D767ADC12B40FD1008D335E /* polybuild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D767ADB12B40FD1008D335E /* polybuild.cpp */; };
+		6D767AFC12B41413008D335E /* PolyString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D767AFB12B41413008D335E /* PolyString.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		6D767ACD12B40E3F008D335E /* polybuild */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = polybuild; sourceTree = BUILT_PRODUCTS_DIR; };
+		6D767AD912B40FD1008D335E /* polybuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = polybuild.h; sourceTree = "<group>"; };
+		6D767ADB12B40FD1008D335E /* polybuild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = polybuild.cpp; sourceTree = "<group>"; };
+		6D767AFB12B41413008D335E /* PolyString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyString.cpp; path = ../../../Core/Contents/Source/PolyString.cpp; sourceTree = SOURCE_ROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		6D767ACB12B40E3F008D335E /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		6D767AAD12B40D59008D335E = {
+			isa = PBXGroup;
+			children = (
+				6D767AD712B40FD1008D335E /* polybuild */,
+				6D767ACE12B40E3F008D335E /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		6D767ACE12B40E3F008D335E /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				6D767ACD12B40E3F008D335E /* polybuild */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		6D767AD712B40FD1008D335E /* polybuild */ = {
+			isa = PBXGroup;
+			children = (
+				6D767AD812B40FD1008D335E /* Include */,
+				6D767ADA12B40FD1008D335E /* Source */,
+			);
+			name = polybuild;
+			path = ../../Contents/polybuild;
+			sourceTree = SOURCE_ROOT;
+		};
+		6D767AD812B40FD1008D335E /* Include */ = {
+			isa = PBXGroup;
+			children = (
+				6D767AD912B40FD1008D335E /* polybuild.h */,
+			);
+			path = Include;
+			sourceTree = "<group>";
+		};
+		6D767ADA12B40FD1008D335E /* Source */ = {
+			isa = PBXGroup;
+			children = (
+				6D767AFB12B41413008D335E /* PolyString.cpp */,
+				6D767ADB12B40FD1008D335E /* polybuild.cpp */,
+			);
+			path = Source;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		6D767ACC12B40E3F008D335E /* polybuild */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 6D767AD212B40E40008D335E /* Build configuration list for PBXNativeTarget "polybuild" */;
+			buildPhases = (
+				6D767ACA12B40E3F008D335E /* Sources */,
+				6D767ACB12B40E3F008D335E /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = polybuild;
+			productName = polybuild;
+			productReference = 6D767ACD12B40E3F008D335E /* polybuild */;
+			productType = "com.apple.product-type.tool";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		6D767AAF12B40D59008D335E /* Project object */ = {
+			isa = PBXProject;
+			buildConfigurationList = 6D767AB212B40D59008D335E /* Build configuration list for PBXProject "Tools" */;
+			compatibilityVersion = "Xcode 2.4";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				English,
+				Japanese,
+				French,
+				German,
+			);
+			mainGroup = 6D767AAD12B40D59008D335E;
+			productRefGroup = 6D767ACE12B40E3F008D335E /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				6D767ACC12B40E3F008D335E /* polybuild */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+		6D767ACA12B40E3F008D335E /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				6D767ADC12B40FD1008D335E /* polybuild.cpp in Sources */,
+				6D767AFC12B41413008D335E /* PolyString.cpp in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		6D767AB012B40D59008D335E /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				HEADER_SEARCH_PATHS = ../../../Core/Contents/Include/;
+			};
+			name = Debug;
+		};
+		6D767AB112B40D59008D335E /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				HEADER_SEARCH_PATHS = ../../../Core/Contents/Include/;
+			};
+			name = Release;
+		};
+		6D767AD012B40E40008D335E /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				INSTALL_PATH = /usr/local/bin;
+				PREBINDING = NO;
+				PRODUCT_NAME = polybuild;
+			};
+			name = Debug;
+		};
+		6D767AD112B40E40008D335E /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_MODEL_TUNING = G5;
+				INSTALL_PATH = /usr/local/bin;
+				PREBINDING = NO;
+				PRODUCT_NAME = polybuild;
+				ZERO_LINK = NO;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		6D767AB212B40D59008D335E /* Build configuration list for PBXProject "Tools" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				6D767AB012B40D59008D335E /* Debug */,
+				6D767AB112B40D59008D335E /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		6D767AD212B40E40008D335E /* Build configuration list for PBXNativeTarget "polybuild" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				6D767AD012B40E40008D335E /* Debug */,
+				6D767AD112B40E40008D335E /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 6D767AAF12B40D59008D335E /* Project object */;
+}

+ 13 - 0
Tools/Contents/polybuild/Include/polybuild.h

@@ -0,0 +1,13 @@
+
+#pragma once
+
+#include "stdio.h"
+#include "PolyString.h"
+
+using namespace Polycode;
+
+class BuildArg {
+public:
+	String name;
+	String value;
+};

+ 44 - 0
Tools/Contents/polybuild/Source/polybuild.cpp

@@ -0,0 +1,44 @@
+
+#include "polybuild.h"
+
+vector<BuildArg> args;
+
+String getArg(String argName) {
+	for(int i=0; i < args.size(); i++) {
+		if(args[i].name == argName) {
+			return args[i].value;
+		}
+	}
+	return "";
+}
+
+int main(int argc, char **argv) {
+
+	printf("Polycode build tool v0.1.0\n");
+
+	for(int i=0; i < argc; i++) {
+		String argString = String(argv[i]);
+		vector<String> bits = argString.split("=");
+		if(bits.size() == 2) {
+			BuildArg arg;
+			arg.name = bits[0];
+			arg.value = bits[1];
+			args.push_back(arg);
+		}
+		
+	}
+	
+	if(getArg("--project") == "") {
+		printf("\n\nInput project missing. Use --project=projectPath to specify.\n\n");
+		return 0;
+	}
+
+	if(getArg("--out") == "") {
+		printf("\n\nOutput file not specified. Use --out=outfile.poly to specify.\n\n");
+		return 0;		
+	}
+	
+	
+	
+	return 1;
+}