agate-svn-commit Mailing List for AgateLib (Page 13)
Status: Alpha
Brought to you by:
kanato
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
(86) |
May
(77) |
Jun
|
Jul
(1) |
Aug
(31) |
Sep
(12) |
Oct
(31) |
Nov
(53) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(53) |
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(13) |
2011 |
Jan
(17) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(21) |
Dec
|
2012 |
Jan
(6) |
Feb
(14) |
Mar
(5) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(8) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(5) |
Nov
(9) |
Dec
(5) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
|
Jun
(5) |
Jul
(33) |
Aug
(69) |
Sep
(35) |
Oct
(4) |
Nov
(1) |
Dec
|
From: <ka...@us...> - 2010-02-21 22:46:42
|
Revision: 1237 http://agate.svn.sourceforge.net/agate/?rev=1237&view=rev Author: kanato Date: 2010-02-21 22:46:35 +0000 (Sun, 21 Feb 2010) Log Message: ----------- Initial refactoring of resources. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/AgateLib/DisplayLib/Surface.cs trunk/AgateLib/Gui/IGuiThemeEngine.cs trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs trunk/AgateLib/Resources/AgateResource.cs trunk/AgateLib/Resources/AgateResourceCollection.cs trunk/AgateLib/Resources/AgateResourceException.cs trunk/AgateLib/Resources/AgateResourceLoader.cs trunk/AgateLib/Resources/SurfaceResource.cs Added Paths: ----------- trunk/AgateLib/Gui/ThemeEngines/Venus/CssRenderer.cs trunk/AgateLib/Resources/GuiThemeResource.cs trunk/AgateLib/Resources/ImageResource.cs Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/AgateLib.csproj 2010-02-21 22:46:35 UTC (rev 1237) @@ -1,7 +1,7 @@ <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.30729</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{9490B719-829E-43A7-A5FE-8001F8A81759}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -167,6 +167,7 @@ <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" /> <Compile Include="Gui\AgateGuiException.cs" /> <Compile Include="Gui\Button.cs" /> + <Compile Include="Gui\ThemeEngines\Venus\CssRenderer.cs" /> <Compile Include="Gui\WidgetRenderer.cs" /> <Compile Include="Gui\CheckBox.cs" /> <Compile Include="Gui\ComboBox.cs" /> @@ -213,6 +214,8 @@ <Compile Include="DisplayLib\ImplementationBase\FrameBufferImpl.cs" /> <Compile Include="Platform.cs" /> <Compile Include="PlatformType.cs" /> + <Compile Include="Resources\GuiThemeResource.cs" /> + <Compile Include="Resources\ImageResource.cs" /> <Compile Include="Serialization\Xle\CompressionType.cs" /> <Compile Include="Settings\SettingsGroup.cs" /> <Compile Include="Timing.cs"> Modified: trunk/AgateLib/DisplayLib/Surface.cs =================================================================== --- trunk/AgateLib/DisplayLib/Surface.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/DisplayLib/Surface.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -27,47 +27,6 @@ namespace AgateLib.DisplayLib { /// <summary> - /// Enum which is used to indicate what format an image file is in. - /// </summary> - public enum ImageFileFormat - { - /// <summary> - /// Portable Network Graphics (PNG) format. - /// </summary> - Png, - /// <summary> - /// Windows Bitmap (BMP) format. - /// </summary> - Bmp, - /// <summary> - /// Jpeg format. - /// </summary> - Jpg, - /// <summary> - /// Targa format. - /// </summary> - Tga, - } - - /// <summary> - /// Enum for indicating the sampling mode used when stretching or shrinking surfaces. - /// </summary> - public enum InterpolationMode - { - /// <summary> - /// Use whatever the driver default is. - /// </summary> - Default, - /// <summary> - /// Use the fastest method, usually nearest neighbor pixel sampling. - /// </summary> - Fastest, - /// <summary> - /// Use the nicest method, usually bilinear sampling. - /// </summary> - Nicest, - } - /// <summary> /// Class which represents a pixel surface. /// There are several ways to create a Surface object. The most common /// is to pass the name of an image file. @@ -112,11 +71,10 @@ if (Display.Impl == null) throw new AgateException("AgateLib's display system has not been initialized."); - Resources.AgateResource res = resources[name]; - Resources.SurfaceResource surf = res as Resources.SurfaceResource; + Resources.SurfaceResource surf = resources.Surfaces[name]; + + impl = surf.CreateSurfaceImpl(); - impl = resources.LoadSurfaceImpl(surf.Filename); - Display.DisposeDisplay += new Display.DisposeDisplayHandler(Dispose); Display.PackAllSurfacesEvent += new EventHandler(Display_PackAllSurfacesEvent); } @@ -887,4 +845,46 @@ get { return impl; } } } + + /// <summary> + /// Enum which is used to indicate what format an image file is in. + /// </summary> + public enum ImageFileFormat + { + /// <summary> + /// Portable Network Graphics (PNG) format. + /// </summary> + Png, + /// <summary> + /// Windows Bitmap (BMP) format. + /// </summary> + Bmp, + /// <summary> + /// Jpeg format. + /// </summary> + Jpg, + /// <summary> + /// Targa format. + /// </summary> + Tga, + } + + /// <summary> + /// Enum for indicating the sampling mode used when stretching or shrinking surfaces. + /// </summary> + public enum InterpolationMode + { + /// <summary> + /// Use whatever the driver default is. + /// </summary> + Default, + /// <summary> + /// Use the fastest method, usually nearest neighbor pixel sampling. + /// </summary> + Fastest, + /// <summary> + /// Use the nicest method, usually bilinear sampling. + /// </summary> + Nicest, + } } Modified: trunk/AgateLib/Gui/IGuiThemeEngine.cs =================================================================== --- trunk/AgateLib/Gui/IGuiThemeEngine.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/Gui/IGuiThemeEngine.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -30,12 +30,6 @@ public interface IGuiThemeEngine { /// <summary> - /// Draws the specified widget to the screen. - /// </summary> - /// <param name="widget"></param> - void DrawWidget(Widget widget); - - /// <summary> /// Calculates and returns the minimum size for the widget. /// </summary> /// <param name="widget"></param> Added: trunk/AgateLib/Gui/ThemeEngines/Venus/CssRenderer.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/CssRenderer.cs (rev 0) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/CssRenderer.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.Gui.ThemeEngines.Venus +{ + public class CssRenderer : WidgetRenderer + { + Venus mEngine; + Widget mWidget; + string mClass; + + public CssRenderer(Venus engine, Widget w) + { + mEngine = engine; + mWidget = w; + } + public override void DrawWidget(Widget w) + { + if (mClass != ClassName) + { + LoadCssInfo(); + } + } + + private void LoadCssInfo() + { + } + + string ClassName { get; set; } + + } +} Modified: trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -1,6 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; +using System.IO; using System.Text; using AgateLib.Geometry; @@ -8,6 +9,21 @@ { public class Venus : IGuiThemeEngine { + public Venus() + { + + } + + public void LoadCss(string text) + { + CssData d = new CssData(); + d.Parse(text); + + Css = d; + } + + public CssData Css { get; set; } + #region IGuiThemeEngine Members public void DrawWidget(Widget widget) @@ -77,7 +93,7 @@ public WidgetRenderer CreateRenderer(Widget widget) { - throw new NotImplementedException(); + return new CssRenderer(this, widget); } #endregion Modified: trunk/AgateLib/Resources/AgateResource.cs =================================================================== --- trunk/AgateLib/Resources/AgateResource.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/Resources/AgateResource.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -35,6 +35,11 @@ /// <summary> /// Constructs a base resource object. /// </summary> + public AgateResource() + { } + /// <summary> + /// Constructs a base resource object. + /// </summary> /// <param name="name"></param> public AgateResource(string name) { Modified: trunk/AgateLib/Resources/AgateResourceCollection.cs =================================================================== --- trunk/AgateLib/Resources/AgateResourceCollection.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/Resources/AgateResourceCollection.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -35,13 +35,47 @@ public class AgateResourceCollection : IDictionary<string, AgateResource>, ICollection<AgateResource> { Dictionary<string, AgateResource> mStore = new Dictionary<string, AgateResource>(); + + List<ImageResource> mImages = new List<ImageResource>(); + const string mStringTableKey = "Strings"; + bool mOwnFileProvider; + IFileProvider mFileProvider; + SurfaceResourceList mSurfaceAccessor; + + public class SurfaceResourceList + { + AgateResourceCollection mResources; + + internal SurfaceResourceList(AgateResourceCollection resources) + { + mResources = resources; + } + + public SurfaceResource this[string key] + { + get + { + foreach (var img in mResources.mImages) + { + foreach (var surface in img.Surfaces) + { + if (surface.Name == key) + return surface; + } + } + + throw new AgateResourceException("Could not find the surface resource {0}.", key); + } + } + } /// <summary> /// Constructs a new AgateResourceCollection object. /// </summary> public AgateResourceCollection() { + mSurfaceAccessor = new SurfaceResourceList(this); this.mStore.Add(mStringTableKey, new StringTable()); } /// <summary> @@ -65,13 +99,32 @@ /// <param name="filename"></param> public AgateResourceCollection(IFileProvider fileProvider, string filename) { + mSurfaceAccessor = new SurfaceResourceList(this); + FileProvider = fileProvider; RootDirectory = Path.GetDirectoryName(filename); Load(filename); } + /// <summary> + /// Constructs an AgateResourceCollection by looking for the resources.xml + /// file in the specified archive. All resources are expected to be in the provided + /// archive. + /// </summary> + /// <param name="path">Full or relative path to the archive.</param> + /// <returns></returns> + public static AgateResourceCollection FromZipArchive(string path) + { + ZipFileProvider zip = new ZipFileProvider(path); + var retval= new AgateResourceCollection(zip, "resources.xml"); + + retval.mOwnFileProvider = true; + + return retval; + } + private void Load(string filename) { using (Stream s = FileProvider.OpenRead(filename)) @@ -81,9 +134,14 @@ } /// <summary> - /// + /// Gets or sets the file provider used to laod resources. /// </summary> - public IFileProvider FileProvider { get; set; } + public IFileProvider FileProvider + { + get { return mFileProvider; } + set { mFileProvider = value; } + } + /// <summary> /// /// </summary> @@ -110,11 +168,11 @@ /// <summary> /// Enumerates through the SurfaceResources contained in this group of resources. /// </summary> - public IEnumerable<SurfaceResource> Surfaces + public SurfaceResourceList Surfaces { get { - return Enumerate<SurfaceResource>(); + return mSurfaceAccessor; } } /// <summary> @@ -154,10 +212,18 @@ { if (item is StringTable) this.AddStringsTable((StringTable)item); + else if (item is ImageResource) + { + ImageResource img = (ImageResource)item; + img.FileProvider = FileProvider; + + mImages.Add(img); + } else mStore.Add(item.Name, item); } + /// <summary> /// Adds a strings /// </summary> @@ -376,4 +442,5 @@ } } } + } \ No newline at end of file Modified: trunk/AgateLib/Resources/AgateResourceException.cs =================================================================== --- trunk/AgateLib/Resources/AgateResourceException.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/Resources/AgateResourceException.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -49,11 +49,25 @@ /// /// </summary> /// <param name="message"></param> + public AgateResourceException(string format, params object[] args) + : base(string.Format(format, args)) + { } + /// <summary> + /// + /// </summary> + /// <param name="message"></param> /// <param name="inner"></param> public AgateResourceException(string message, Exception inner) : base(inner, message) { } /// <summary> /// /// </summary> + /// <param name="message"></param> + public AgateResourceException(Exception inner, string format, params object[] args) + : base(inner, string.Format(format, args)) + { } + /// <summary> + /// + /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected AgateResourceException( Modified: trunk/AgateLib/Resources/AgateResourceLoader.cs =================================================================== --- trunk/AgateLib/Resources/AgateResourceLoader.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/Resources/AgateResourceLoader.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -141,7 +141,13 @@ case "DisplayWindow": return new DisplayWindowResource(node, version); - case "Surface": + case "Image": + return new ImageResource(node, version); + + case "GuiTheme": + return new GuiThemeResource(node, version); + + case "Surface": return new SurfaceResource(node, version); case "Sprite": Added: trunk/AgateLib/Resources/GuiThemeResource.cs =================================================================== --- trunk/AgateLib/Resources/GuiThemeResource.cs (rev 0) +++ trunk/AgateLib/Resources/GuiThemeResource.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml; + +namespace AgateLib.Resources +{ + public class GuiThemeResource : AgateResource + { + public string CssFile { get; set; } + + public GuiThemeResource() + { } + public GuiThemeResource(string name) + : base(name) + { } + + internal GuiThemeResource(XmlNode node, string version) + { + Name = XmlHelper.ReadAttributeString(node, "name"); + CssFile = XmlHelper.ReadAttributeString(node, "css"); + } + + internal override void BuildNodes(XmlElement parent, System.Xml.XmlDocument doc) + { + throw new NotImplementedException(); + } + + protected override AgateResource Clone() + { + throw new NotImplementedException(); + } + } +} Added: trunk/AgateLib/Resources/ImageResource.cs =================================================================== --- trunk/AgateLib/Resources/ImageResource.cs (rev 0) +++ trunk/AgateLib/Resources/ImageResource.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml; +using AgateLib.DisplayLib; + +namespace AgateLib.Resources +{ + public class ImageResource : AgateResource + { + Surface mBackingSurface; + List<SurfaceResource> mSurfaces = new List<SurfaceResource>(); + + public ImageResource() + { } + + internal ImageResource(XmlNode node, string version) + { + if (node.Attributes["filename"] == null) + throw new AgateResourceException("Image node did not include the required filename attribute."); + + switch (version) + { + case "0.4.0": + Filename = node.Attributes["filename"].Value; + ReadSubNodes040(node); + break; + + default: + throw new AgateResourceException("Image resource not supported in file version."); + } + } + + private void ReadSubNodes040(XmlNode node) + { + foreach (XmlNode n in node.ChildNodes) + { + switch (n.Name) + { + case "Surface": + ReadSurface(n); + break; + + case "Sprite": + ReadSprite(n); + break; + + default: + throw new AgateResourceException( + "Could not understand node {0} which is a subnode of Image {1}", n.Name, Filename); + } + } + } + + private void ReadSprite(XmlNode n) + { + throw new NotImplementedException(); + } + + private void ReadSurface(XmlNode n) + { + SurfaceResource res = new SurfaceResource(XmlHelper.ReadAttributeString(n, "name")); + + if (n.Attributes["left"] != null || + n.Attributes["top"] != null || + n.Attributes["width"] != null || + n.Attributes["height"] != null) + { + res.SourceRect = new AgateLib.Geometry.Rectangle( + XmlHelper.ReadAttributeInt(n, "left"), + XmlHelper.ReadAttributeInt(n, "top"), + XmlHelper.ReadAttributeInt(n, "width"), + XmlHelper.ReadAttributeInt(n, "height")); + } + + res.Image = this; + mSurfaces.Add(res); + } + + public string Filename { get; set; } + public IFileProvider FileProvider { get; set; } + + public List<SurfaceResource> Surfaces { get { return mSurfaces; } } + + public Surface GetOrLoadSurface() + { + if (mBackingSurface == null) + { + mBackingSurface = new Surface(FileProvider, Filename); + } + + return mBackingSurface; + } + internal override void BuildNodes(XmlElement parent, XmlDocument doc) + { + throw new NotImplementedException(); + } + + protected override AgateResource Clone() + { + throw new NotImplementedException(); + } + + } +} Modified: trunk/AgateLib/Resources/SurfaceResource.cs =================================================================== --- trunk/AgateLib/Resources/SurfaceResource.cs 2010-02-21 07:36:58 UTC (rev 1236) +++ trunk/AgateLib/Resources/SurfaceResource.cs 2010-02-21 22:46:35 UTC (rev 1237) @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.Text; using System.Xml; +using AgateLib.DisplayLib; using AgateLib.Geometry; namespace AgateLib.Resources @@ -31,14 +32,25 @@ /// </summary> public sealed class SurfaceResource : AgateResource { - string mFilename; + ImageResource mImage; + Rectangle mSrcRect; /// <summary> /// Gets or sets the filename for the surface to be created from. /// </summary> - public string Filename { get { return mFilename; } set { mFilename = value; } } + [Obsolete] + public string Filename { get; set; } /// <summary> + /// Gets or sets the source rectangle in the image file. + /// </summary> + public Rectangle SourceRect + { + get { return mSrcRect; } + set { mSrcRect = value; } + } + + /// <summary> /// Constructs a SurfaceResource object. /// </summary> /// <param name="name"></param> @@ -61,8 +73,10 @@ case "0.3.1": case "0.3.0": Name = node.Attributes["name"].Value; - Filename = node.Attributes["filename"].Value; + mImage = new ImageResource(); + mImage.Filename = node.Attributes["filename"].Value; + break; default: @@ -89,5 +103,18 @@ { return new SurfaceResource(Name, Filename); } + + internal AgateLib.DisplayLib.ImplementationBase.SurfaceImpl CreateSurfaceImpl() + { + Surface s = mImage.GetOrLoadSurface(); + + return s.Impl.CarveSubSurface(mSrcRect); + } + + internal ImageResource Image + { + get { return mImage; } + set { mImage = value; } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-21 07:37:04
|
Revision: 1236 http://agate.svn.sourceforge.net/agate/?rev=1236&view=rev Author: kanato Date: 2010-02-21 07:36:58 +0000 (Sun, 21 Feb 2010) Log Message: ----------- Fix use of extraSpace parameter to AddNewFrames. Modified Paths: -------------- trunk/AgateLib/Sprites/Sprite.cs Modified: trunk/AgateLib/Sprites/Sprite.cs =================================================================== --- trunk/AgateLib/Sprites/Sprite.cs 2010-02-20 18:46:49 UTC (rev 1235) +++ trunk/AgateLib/Sprites/Sprite.cs 2010-02-21 07:36:58 UTC (rev 1236) @@ -371,12 +371,12 @@ if (skip == false) mFrames.Add(currentFrame); - location.X += size.Width; + location.X += size.Width + extraSpace.X; if (location.X + size.Width > surface.SurfaceWidth) { location.X = 0; - location.Y += size.Height; + location.Y += size.Height + extraSpace.Y; } } while (location.Y + size.Height <= surface.SurfaceHeight); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-20 18:46:56
|
Revision: 1235 http://agate.svn.sourceforge.net/agate/?rev=1235&view=rev Author: kanato Date: 2010-02-20 18:46:49 +0000 (Sat, 20 Feb 2010) Log Message: ----------- Catch exception thrown in FrameBufferExt constructor and fall back go ReadPixels framebuffer implementation. Modified Paths: -------------- trunk/Drivers/AgateOTK/GL_Display.cs trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs Modified: trunk/Drivers/AgateOTK/GL_Display.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Display.cs 2010-02-18 22:34:23 UTC (rev 1234) +++ trunk/Drivers/AgateOTK/GL_Display.cs 2010-02-20 18:46:49 UTC (rev 1235) @@ -148,9 +148,27 @@ if (mGL3) return new GL3.FrameBuffer(size); else if (mSupportsFramebufferExt) - return new Legacy.FrameBufferExt(size); - else - return new Legacy.FrameBufferReadPixels(size); + { + try + { + return new Legacy.FrameBufferExt(size); + } + catch(Exception e) + { + Trace.WriteLine(string.Format("Caught exception {0} when trying to create GL_FrameBuffer_Ext wrapper.", e.GetType())); + Trace.Indent(); + Trace.WriteLine(e.Message); + Trace.Unindent(); + Trace.WriteLine(""); + Trace.WriteLine("Disabling frame buffer extension, and falling back onto glCopyTexSubImage2D."); + Trace.WriteLine("Extensive use of offscreen rendering targets will result in poor performance."); + Trace.WriteLine(""); + + mSupportsFramebufferExt = false; + } + } + + return new Legacy.FrameBufferReadPixels(size); } public GLDrawBuffer CreateDrawBuffer() @@ -181,7 +199,7 @@ internal GLDrawBuffer DrawBuffer { - get { return (RenderTarget.Impl as GL_FrameBuffer).DrawBuffer; } + get { return ((GL_FrameBuffer)RenderTarget.Impl).DrawBuffer; } } // TODO: Test clip rect stuff. @@ -545,6 +563,9 @@ { lock (mTexturesToDelete) { + if (mTexturesToDelete.Count == 0) + return; + int[] tex = mTexturesToDelete.ToArray(); mTexturesToDelete.Clear(); Modified: trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs 2010-02-18 22:34:23 UTC (rev 1234) +++ trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs 2010-02-20 18:46:49 UTC (rev 1235) @@ -43,17 +43,14 @@ GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, - (int)TextureMinFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, - (int)TextureMagFilter.Linear); - - surface.Draw(s); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); + + surface.Draw(s); + + DrawBuffer.Flush(); } public override void EndRender() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-18 22:34:30
|
Revision: 1234 http://agate.svn.sourceforge.net/agate/?rev=1234&view=rev Author: kanato Date: 2010-02-18 22:34:23 +0000 (Thu, 18 Feb 2010) Log Message: ----------- Reorganize GUI theming and add preliminary Venus code. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/AgateLib/Geometry/Rectangle.cs trunk/AgateLib/Gui/Container.cs trunk/AgateLib/Gui/GuiRoot.cs trunk/AgateLib/Gui/IGuiThemeEngine.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/ScrollBarCache.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryButton.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryCheckBox.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryLabel.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryListBox.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryPanel.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScrollBar.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWidget.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWindow.cs trunk/AgateLib/Gui/Widget.cs trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs trunk/Tests/Tests.csproj Added Paths: ----------- trunk/AgateLib/Gui/ThemeEngines/Venus/ trunk/AgateLib/Gui/ThemeEngines/Venus/CssData.cs trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs trunk/AgateLib/Gui/ThemeEngines/Venus/VenusScheme.cs trunk/AgateLib/Gui/ThemeEngines/Venus/VenusTheme.cs trunk/AgateLib/Gui/ThemeEngines/Venus/VenusThemeDictionary.cs trunk/AgateLib/Gui/ThemeEngines/Venus/WidgetStyle.cs trunk/AgateLib/Gui/WidgetRenderer.cs trunk/Tests/Data/CssTest.css trunk/Tests/GuiTests/CssParserTest.cs Removed Paths: ------------- trunk/AgateLib/Gui/Cache/WidgetCache.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/AgateLib.csproj 2010-02-18 22:34:23 UTC (rev 1234) @@ -1,7 +1,7 @@ <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{9490B719-829E-43A7-A5FE-8001F8A81759}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -167,7 +167,7 @@ <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" /> <Compile Include="Gui\AgateGuiException.cs" /> <Compile Include="Gui\Button.cs" /> - <Compile Include="Gui\Cache\WidgetCache.cs" /> + <Compile Include="Gui\WidgetRenderer.cs" /> <Compile Include="Gui\CheckBox.cs" /> <Compile Include="Gui\ComboBox.cs" /> <Compile Include="Gui\Container.cs" /> @@ -185,7 +185,6 @@ <Compile Include="Gui\RadioButton.cs" /> <Compile Include="Gui\TextBox.cs" /> <Compile Include="Gui\ThemeEngines\Mercury\Cache\ScrollBarCache.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\Cache\TextBoxCache.cs" /> <Compile Include="Gui\ThemeEngines\Mercury\Mercury.cs" /> <Compile Include="Gui\ThemeEngines\Mercury\MercuryButton.cs" /> <Compile Include="Gui\ThemeEngines\Mercury\MercuryCheckBox.cs" /> @@ -199,6 +198,12 @@ <Compile Include="Gui\ThemeEngines\Mercury\MercuryScrollBar.cs" /> <Compile Include="Gui\ThemeEngines\Mercury\MercuryTextBox.cs" /> <Compile Include="Gui\ThemeEngines\Mercury\MercuryWindow.cs" /> + <Compile Include="Gui\ThemeEngines\Venus\CssData.cs" /> + <Compile Include="Gui\ThemeEngines\Venus\Venus.cs" /> + <Compile Include="Gui\ThemeEngines\Venus\VenusScheme.cs" /> + <Compile Include="Gui\ThemeEngines\Venus\VenusTheme.cs" /> + <Compile Include="Gui\ThemeEngines\Venus\VenusThemeDictionary.cs" /> + <Compile Include="Gui\ThemeEngines\Venus\WidgetStyle.cs" /> <Compile Include="Gui\Widget.cs" /> <Compile Include="Gui\WidgetList.cs" /> <Compile Include="Gui\Window.cs" /> @@ -622,6 +627,9 @@ <None Include="InternalResources\Fonts.zip" /> <None Include="InternalResources\images.tar.gz" /> </ItemGroup> + <ItemGroup> + <Folder Include="Gui\Cache\" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <PropertyGroup> <PreBuildEvent> Modified: trunk/AgateLib/Geometry/Rectangle.cs =================================================================== --- trunk/AgateLib/Geometry/Rectangle.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Geometry/Rectangle.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -191,9 +191,9 @@ return false; if (pt.Y < Top) return false; - if (pt.X > Right) + if (pt.X >= Right) return false; - if (pt.Y > Bottom) + if (pt.Y >= Bottom) return false; return true; @@ -470,5 +470,19 @@ } + /// <summary> + /// Returns a rectangle which has the two specified points as corners. + /// </summary> + /// <param name="a"></param> + /// <param name="b"></param> + /// <returns></returns> + public static Rectangle FromPoints(Point a, Point b) + { + return new Rectangle( + Math.Min(a.X, b.X), + Math.Min(a.Y, b.Y), + Math.Abs(a.X - b.X), + Math.Abs(a.Y - b.Y)); + } } } \ No newline at end of file Deleted: trunk/AgateLib/Gui/Cache/WidgetCache.cs =================================================================== --- trunk/AgateLib/Gui/Cache/WidgetCache.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/Cache/WidgetCache.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -1,75 +0,0 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using AgateLib.Geometry; - -namespace AgateLib.Gui.Cache -{ - /// <summary> - /// Base class for a cache object used by widgets. - /// </summary> - public class WidgetCache - { - RectangleF mDisplayRect; - - /// <summary> - /// Constructs a widget cache object. - /// </summary> - public WidgetCache() - { - Dirty = true; - } - - /// <summary> - /// Indicates whether or not the cache is dirty and needs to be recalculated. - /// </summary> - public bool Dirty { get; set; } - - public RectangleF DisplayRect { get{return mDisplayRect; } - set { mDisplayRect = value; } - } - public SizeF DisplaySize - { - get { return mDisplayRect.Size; } - set { mDisplayRect.Size = value; } - } - public PointF DisplayLocation - { - get { return mDisplayRect.Location; } - set { mDisplayRect.Location = value; } - } - - public float DisplayWidth - { - get { return mDisplayRect.Width; } - set { mDisplayRect.Width = value; } - } - public float DisplayHeight - { - get { return mDisplayRect.Height; } - set { mDisplayRect.Height = value; } - } - - public bool DisplayVisible { get; set; } - public float DisplayAlpha { get; set; } - } -} Modified: trunk/AgateLib/Gui/Container.cs =================================================================== --- trunk/AgateLib/Gui/Container.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/Container.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -279,6 +279,16 @@ return Layout.CanMoveFocus(this, currentFocus, direction); } + + public override void RecreateRenderer() + { + base.RecreateRenderer(); + + foreach (var w in Children) + { + w.RecreateRenderer(); + } + } } public enum Direction Modified: trunk/AgateLib/Gui/GuiRoot.cs =================================================================== --- trunk/AgateLib/Gui/GuiRoot.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/GuiRoot.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -45,7 +45,7 @@ Name = "root"; Layout = new Layout.Grid(); - themeEngine = new ThemeEngines.Mercury.Mercury(); + ThemeEngine = new ThemeEngines.Mercury.Mercury(); } /// <summary> /// Constructs a GuiRoot object and uses the specified theme engine. @@ -85,6 +85,8 @@ throw new ArgumentNullException("RenderEngine must not be null."); themeEngine = value; + + RecreateRenderer(); } } /// <summary> Modified: trunk/AgateLib/Gui/IGuiThemeEngine.cs =================================================================== --- trunk/AgateLib/Gui/IGuiThemeEngine.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/IGuiThemeEngine.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -111,5 +111,7 @@ /// </summary> /// <param name="widget"></param> void WidgetNeedsUpdate(Widget widget); + + WidgetRenderer CreateRenderer(Widget widget); } } Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/ScrollBarCache.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/ScrollBarCache.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/ScrollBarCache.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -21,25 +21,9 @@ using System.Linq; using System.Text; using AgateLib.Geometry; -using AgateLib.Gui.Cache; + namespace AgateLib.Gui.ThemeEngines.Mercury.Cache { - class ScrollBarCache : WidgetCache - { - public bool DownInDecrease { get; set; } - public bool DownInIncrease { get; set; } - public bool DownInPageDecrease { get; set; } - public bool DownInPageIncrease { get; set; } - public bool MouseInDecrease { get; set; } - public bool MouseInIncrease { get; set; } - public bool MouseInPageDecrease { get; set; } - public bool MouseInPageIncrease { get; set; } - - public double LastUpdate { get; set; } - - public bool DraggingThumb { get; set; } - public Point ThumbGrabSpot { get; set; } - } } Deleted: trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -1,44 +0,0 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using AgateLib.DisplayLib; -using AgateLib.Geometry; - -namespace AgateLib.Gui.ThemeEngines.Mercury.Cache -{ - class TextBoxCache : Gui.Cache.WidgetCache - { - public FrameBuffer TextBoxFrameBuffer { get; set; } - public Surface TextBoxSurface - { - get - { - if (TextBoxFrameBuffer == null) - return null; - else - return TextBoxFrameBuffer.RenderTarget; - } - } - - public Point Origin; - } -} Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -23,7 +23,6 @@ using System.Diagnostics; using AgateLib.DisplayLib; using AgateLib.Geometry; -using AgateLib.Gui.ThemeEngines.Mercury.Cache; namespace AgateLib.Gui.ThemeEngines.Mercury { @@ -49,8 +48,20 @@ public Mercury(MercuryScheme scheme) { this.Scheme = scheme; + + mRendererMap.Add(typeof(TextBox), typeof(MercuryTextBox)); + mRendererMap.Add(typeof(CheckBox), typeof(MercuryCheckBox)); + mRendererMap.Add(typeof(RadioButton), typeof(MercuryCheckBox)); + mRendererMap.Add(typeof(Button), typeof(MercuryButton)); + mRendererMap.Add(typeof(GuiRoot), typeof(MercuryGuiRoot)); + mRendererMap.Add(typeof(Label), typeof(MercuryLabel)); + mRendererMap.Add(typeof(Panel), typeof(MercuryPanel)); + mRendererMap.Add(typeof(Window), typeof(MercuryWindow)); + + } + /// <summary> /// Gets or sets the parameters used to draw widgets. /// </summary> @@ -78,6 +89,12 @@ } #endregion + Dictionary<Type, Type> mRendererMap = new Dictionary<Type, Type>(); + + public WidgetRenderer CreateRenderer(Widget widget) + { + return (WidgetRenderer)Activator.CreateInstance(mRendererMap[widget.GetType()], this.Scheme, widget); + } #region --- Interface Dispatchers --- /// <summary> @@ -253,5 +270,7 @@ return Scheme.Themer(widget).ClientArea(widget); } + + } } \ No newline at end of file Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryButton.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryButton.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryButton.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -22,7 +22,6 @@ using System.Text; using AgateLib.DisplayLib; using AgateLib.Geometry; -using AgateLib.Gui.Cache; namespace AgateLib.Gui.ThemeEngines.Mercury { @@ -40,9 +39,21 @@ public Surface Focus { get; set; } public int TextPadding { get; set; } - public MercuryButton(MercuryScheme scheme) - : base(scheme) - { } + public MercuryButton(MercuryScheme scheme, Widget widget) + : base(scheme, widget) + { + if (scheme.Button != null) + { + StretchRegion = scheme.Button.StretchRegion; + Image = scheme.Button.Image; + Default = scheme.Button.Default; + Pressed = scheme.Button.Pressed; + Disabled = scheme.Button.Disabled; + Hover = scheme.Button.Hover; + Focus = scheme.Button.Focus; + TextPadding = scheme.Button.TextPadding; + } + } public override void DrawWidget(Widget w) { @@ -51,7 +62,6 @@ public void DrawButton(Button button) { Surface image = Image; - WidgetCache c = GetButtonCache(button); bool isDefault = button.IsDefaultButton; @@ -63,7 +73,7 @@ image = Default; Point location = button.PointToScreen(Point.Empty); - Size size = new Size((int)c.DisplayWidth, (int)c.DisplayHeight); + Size size = new Size((int)DisplayWidth, (int)DisplayHeight); DrawStretchImage(location, size, image, StretchRegion); @@ -100,19 +110,6 @@ button.Text); } - private WidgetCache GetButtonCache(Button button) - { - if (button.Cache == null) - { - button.Cache = new WidgetCache(); - - button.Cache.DisplayLocation = (PointF)button.Location; - button.Cache.DisplaySize = (SizeF)button.Size; - } - - return button.Cache; - } - public override Size MinSize(Widget w) { return CalcMinButtonSize((Button)w); Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryCheckBox.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryCheckBox.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryCheckBox.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -22,7 +22,6 @@ using System.Text; using AgateLib.DisplayLib; using AgateLib.Geometry; -using AgateLib.Gui.Cache; namespace AgateLib.Gui.ThemeEngines.Mercury { @@ -37,12 +36,27 @@ public Surface Hover { get; set; } public Surface Focus { get; set; } public int Spacing { get; set; } - - public MercuryCheckBox(MercuryScheme scheme) - : base(scheme) + + public MercuryCheckBox(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { Spacing = 5; Margin = 2; + + MercuryCheckBox src = scheme.CheckBox; + + if (widget is RadioButton) + src = scheme.RadioButton; + + if (src != null) + { + Image = src.Image; + Disabled = src.Disabled; + Check = src.Check; + Hover = src.Hover; + Focus = src.Focus; + Spacing = src.Spacing; + } } public override void DrawWidget(Widget w) @@ -61,10 +75,9 @@ else surf = Image; - WidgetCache c = GetOrCreateCache(checkbox); Point destPoint = checkbox.PointToScreen( - Origin.Calc(OriginAlignment.CenterLeft, (Size)c.DisplaySize)); + Origin.Calc(OriginAlignment.CenterLeft, (Size)DisplaySize)); surf.DisplayAlignment = OriginAlignment.CenterLeft; surf.Draw(destPoint); Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -32,8 +32,8 @@ /// Constructs a MercuryGuiRoot object. /// </summary> /// <param name="scheme"></param> - public MercuryGuiRoot(MercuryScheme scheme) - : base(scheme) + public MercuryGuiRoot(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { } /// <summary> Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryLabel.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryLabel.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryLabel.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -34,8 +34,8 @@ /// Constructs a MercuryLabel object. /// </summary> /// <param name="scheme"></param> - public MercuryLabel(MercuryScheme scheme) - : base(scheme) + public MercuryLabel(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { } /// <summary> Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryListBox.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryListBox.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryListBox.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -36,8 +36,8 @@ public Surface Focus { get; set; } public Rectangle StretchRegion { get; set; } - public MercuryListBox(MercuryScheme scheme) - :base(scheme) + public MercuryListBox(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { Margin = 3; } Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryPanel.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryPanel.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryPanel.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -32,8 +32,8 @@ /// Constructs a MercuryPanel object. /// </summary> /// <param name="scheme"></param> - public MercuryPanel(MercuryScheme scheme) - : base(scheme) + public MercuryPanel(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { } /// <summary> /// Does nothing. Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -52,15 +52,15 @@ private MercuryScheme() { - mLabel = new MercuryLabel(this); - mWindow = new MercuryWindow(this); - mButton = new MercuryButton(this); - mCheckBox = new MercuryCheckBox(this); - mRadioButton = new MercuryCheckBox(this); - mTextBox = new MercuryTextBox(this); - mListBox = new MercuryListBox(this); - mVScroll = new MercuryScrollBar(this); - mHScroll = new MercuryScrollBar(this); + mLabel = new MercuryLabel(this, null); + mWindow = new MercuryWindow(this, null); + mButton = new MercuryButton(this, null); + mCheckBox = new MercuryCheckBox(this, null); + mRadioButton = new MercuryCheckBox(this, null); + mTextBox = new MercuryTextBox(this, null); + mListBox = new MercuryListBox(this, null); + mVScroll = new MercuryScrollBar(this, null); + mHScroll = new MercuryScrollBar(this, null); mDispatch.Add(typeof(Label), mLabel); mDispatch.Add(typeof(Window), mWindow); @@ -71,9 +71,8 @@ mDispatch.Add(typeof(ListBox), mListBox); mDispatch.Add(typeof(VerticalScrollBar), mVScroll); mDispatch.Add(typeof(HorizontalScrollBar), mHScroll); - mDispatch.Add(typeof(Panel), new MercuryPanel(this)); - mDispatch.Add(typeof(GuiRoot), new MercuryGuiRoot(this)); - + mDispatch.Add(typeof(Panel), new MercuryPanel(this, null)); + mDispatch.Add(typeof(GuiRoot), new MercuryGuiRoot(this, null)); } public MercuryWidget Themer(Widget w) Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScrollBar.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScrollBar.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScrollBar.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -25,8 +25,6 @@ namespace AgateLib.Gui.ThemeEngines.Mercury { - using Cache; - /// <summary> /// Class which draws scroll bars for the Mercury theme engine. /// </summary> @@ -53,10 +51,25 @@ public Rectangle BarStretchRegion { get; set; } public Rectangle ThumbStretchRegion { get; set; } + public bool DownInDecrease { get; set; } + public bool DownInIncrease { get; set; } + public bool DownInPageDecrease { get; set; } + public bool DownInPageIncrease { get; set; } + + public bool MouseInDecrease { get; set; } + public bool MouseInIncrease { get; set; } + public bool MouseInPageDecrease { get; set; } + public bool MouseInPageIncrease { get; set; } + + public double LastUpdate { get; set; } + + public bool DraggingThumb { get; set; } + public Point ThumbGrabSpot { get; set; } + public int FixedBarSize { get; set; } - public MercuryScrollBar(MercuryScheme scheme) - : base(scheme) + public MercuryScrollBar(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { FixedBarSize = 16; } @@ -81,13 +94,11 @@ DrawStretchImage(barLoc, sz, Bar, BarStretchRegion); - var cache = GetCache(scrollBar); - if (Mercury.DebugOutlines) { DrawRect(scrollBar, PageDecreaseRegion(scrollBar), Color.LightGreen); DrawRect(scrollBar, PageIncreaseRegion(scrollBar), Color.Green); - DrawRect(scrollBar, ThumbRegion(scrollBar), cache.DraggingThumb ? Color.LightBlue: Color.Blue); + DrawRect(scrollBar, ThumbRegion(scrollBar), DraggingThumb ? Color.LightBlue: Color.Blue); } } @@ -144,41 +155,38 @@ } void UpdateScrollBar(ScrollBar bar) { - var cache = GetCache(bar); - - if (cache.LastUpdate + 0.1 > Timing.TotalSeconds) + if (LastUpdate + 0.1 > Timing.TotalSeconds) return; UpdateMouseLocation(bar, bar.PointToClient(AgateLib.InputLib.Mouse.Position)); - if (cache.DownInDecrease && cache.MouseInDecrease) + if (DownInDecrease && MouseInDecrease) SafeMoveScrollBar(bar, -bar.SmallChange); - if (cache.DownInIncrease && cache.MouseInIncrease) + if (DownInIncrease && MouseInIncrease) SafeMoveScrollBar(bar, bar.SmallChange); - if (cache.DownInPageDecrease && cache.MouseInPageDecrease) + if (DownInPageDecrease && MouseInPageDecrease) SafeMoveScrollBar(bar, -bar.LargeChange); - if (cache.DownInPageIncrease && cache.MouseInPageIncrease) + if (DownInPageIncrease && MouseInPageIncrease) SafeMoveScrollBar(bar, bar.LargeChange); - cache.LastUpdate = Timing.TotalSeconds; + LastUpdate = Timing.TotalSeconds; } private void UpdateMouseLocation(ScrollBar scrollBar, Point clientLocation) { - var cache = GetCache(scrollBar); - cache.MouseInDecrease = false; - cache.MouseInIncrease = false; - cache.MouseInPageDecrease = false; - cache.MouseInPageIncrease = false; + MouseInDecrease = false; + MouseInIncrease = false; + MouseInPageDecrease = false; + MouseInPageIncrease = false; if (DecreaseRegion(scrollBar).Contains(clientLocation)) - cache.MouseInDecrease = true; + MouseInDecrease = true; else if (IncreaseRegion(scrollBar).Contains(clientLocation)) - cache.MouseInIncrease = true; + MouseInIncrease = true; else if (PageDecreaseRegion(scrollBar).Contains(clientLocation)) - cache.MouseInPageDecrease = true; + MouseInPageDecrease = true; else if (PageIncreaseRegion(scrollBar).Contains(clientLocation)) - cache.MouseInPageIncrease = true; + MouseInPageIncrease = true; } private void SafeMoveScrollBar(ScrollBar scrollBar, int change) @@ -196,46 +204,37 @@ return newValue; } - ScrollBarCache GetCache(ScrollBar bar) - { - if (bar.Cache == null) - bar.Cache = new ScrollBarCache(); - - return (ScrollBarCache)bar.Cache; - } - public void MouseDownInScrollBar(ScrollBar scrollBar, Point clientLocation) { - var cache = GetCache(scrollBar); Rectangle thumb = ThumbRegion(scrollBar); - cache.LastUpdate = Timing.TotalSeconds + 0.25; + LastUpdate = Timing.TotalSeconds + 0.25; Scheme.RegisterUpdater(this, scrollBar); if (DecreaseRegion(scrollBar).Contains(clientLocation)) { - cache.DownInDecrease = true; + DownInDecrease = true; SafeMoveScrollBar(scrollBar, -scrollBar.SmallChange); } else if (IncreaseRegion(scrollBar).Contains(clientLocation)) { - cache.DownInIncrease = true; + DownInIncrease = true; SafeMoveScrollBar(scrollBar, scrollBar.SmallChange); } else if (thumb.Contains(clientLocation)) { - cache.DraggingThumb = true; - cache.ThumbGrabSpot = new Point(clientLocation.X - thumb.X, clientLocation.Y - thumb.Y); + DraggingThumb = true; + ThumbGrabSpot = new Point(clientLocation.X - thumb.X, clientLocation.Y - thumb.Y); } else if (PageDecreaseRegion(scrollBar).Contains(clientLocation)) { - cache.DownInPageDecrease = true; + DownInPageDecrease = true; SafeMoveScrollBar(scrollBar, -scrollBar.LargeChange); } else if (PageIncreaseRegion(scrollBar).Contains(clientLocation)) { - cache.DownInPageIncrease = true; + DownInPageIncrease = true; SafeMoveScrollBar(scrollBar, scrollBar.LargeChange); } @@ -243,13 +242,12 @@ } public void MouseMoveInScrollBar(ScrollBar scrollBar, Point clientLocation) { - var cache = GetCache(scrollBar); UpdateMouseLocation(scrollBar, clientLocation); - if (cache.DraggingThumb) + if (DraggingThumb) { - Point newThumbPos = new Point(clientLocation.X - cache.ThumbGrabSpot.X, - clientLocation.Y - cache.ThumbGrabSpot.Y); + Point newThumbPos = new Point(clientLocation.X - ThumbGrabSpot.X, + clientLocation.Y - ThumbGrabSpot.Y); int newThumbStart = scrollBar is VerticalScrollBar ? newThumbPos.Y : newThumbPos.X; int thumbSize = ThumbSize(scrollBar); @@ -266,13 +264,11 @@ } public void MouseUpInScrollBar(ScrollBar scrollBar, Point clientLocation) { - var cache = GetCache(scrollBar); - - cache.DownInDecrease = false; - cache.DownInIncrease = false; - cache.DownInPageDecrease = false; - cache.DownInPageIncrease = false; - cache.DraggingThumb = false; + DownInDecrease = false; + DownInIncrease = false; + DownInPageDecrease = false; + DownInPageIncrease = false; + DraggingThumb = false; Scheme.RemoveUpdater(this, scrollBar); } Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -25,8 +25,6 @@ namespace AgateLib.Gui.ThemeEngines.Mercury { - using Cache; - /// <summary> /// Class which draws text boxes for the Mercury theme engine. /// </summary> @@ -38,13 +36,39 @@ public Surface Focus { get; set; } public Rectangle StretchRegion { get; set; } - public MercuryTextBox(MercuryScheme scheme) - : base(scheme) + public MercuryTextBox(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { Margin = 3; + + if (scheme.TextBox != null) + { + Image = scheme.TextBox.Image; + Disabled = scheme.TextBox.Disabled; + Hover = scheme.TextBox.Hover; + Focus = scheme.TextBox.Focus; + StretchRegion = scheme.TextBox.StretchRegion; + } } + #region --- Cache --- + public FrameBuffer TextBoxFrameBuffer { get; set; } + public Surface TextBoxSurface + { + get + { + if (TextBoxFrameBuffer == null) + return null; + else + return TextBoxFrameBuffer.RenderTarget; + } + } + + public Point Origin; + + #endregion + public void MouseDownInTextBox(TextBox textBox, Point clientLocation) { textBox.MoveInsertionPoint( @@ -63,26 +87,9 @@ { } - public override AgateLib.Gui.Cache.WidgetCache GetOrCreateCache(Widget w) - { - return GetTextBoxCache((TextBox)w); - } - private TextBoxCache GetTextBoxCache(TextBox textBox) - { - if (textBox.Cache == null) - { - textBox.Cache = new TextBoxCache(); - - base.InitializeCache(textBox, textBox.Cache); - } - - return (TextBoxCache)textBox.Cache; - } public void UpdateCache(TextBox textBox) { - TextBoxCache c = GetTextBoxCache(textBox); - - if (c.Dirty == false) + if (Dirty == false) return; Size fixedSize = StretchRegionFixedSize(Image.SurfaceSize, StretchRegion); @@ -90,13 +97,13 @@ Size surfSize = new Size(textBox.Size.Width - fixedSize.Width, textBox.Size.Height - fixedSize.Height); - if (c.TextBoxFrameBuffer == null || c.TextBoxFrameBuffer.Size != surfSize) + if (TextBoxFrameBuffer == null || TextBoxFrameBuffer.Size != surfSize) { - if (c.TextBoxFrameBuffer != null) - c.TextBoxFrameBuffer.Dispose(); + if (TextBoxFrameBuffer != null) + TextBoxFrameBuffer.Dispose(); - c.TextBoxFrameBuffer = new FrameBuffer(surfSize); - c.Origin = Point.Empty; + TextBoxFrameBuffer = new FrameBuffer(surfSize); + Origin = Point.Empty; } Point ip = InsertionPointLocation(textBox); @@ -105,16 +112,16 @@ int bottom = ip.Y + InsertionPointHeight; if (ip.Y < 0) - c.Origin.Y += ip.Y; + Origin.Y += ip.Y; if (bottom > surfSize.Height) - c.Origin.Y += bottom - surfSize.Height; + Origin.Y += bottom - surfSize.Height; if (ip.X < 0) - c.Origin.X += ip.X; + Origin.X += ip.X; if (ip.X >= surfSize.Width) - c.Origin.X += ip.X - surfSize.Width + 1; + Origin.X += ip.X - surfSize.Width + 1; FrameBuffer old = Display.RenderTarget; - Display.RenderTarget = c.TextBoxFrameBuffer; + Display.RenderTarget = TextBoxFrameBuffer; Display.RenderState.AlphaBlend = false; Display.BeginFrame(); @@ -125,13 +132,13 @@ else WidgetFont.Color = FontColorDisabled; - WidgetFont.DrawText(-c.Origin.X, -c.Origin.Y, textBox.Text); + WidgetFont.DrawText(-Origin.X, -Origin.Y, textBox.Text); Display.EndFrame(); Display.RenderTarget = old; Display.RenderState.AlphaBlend = true; - c.Dirty = false; + Dirty = false; } public override void DrawWidget(Widget w) @@ -145,10 +152,8 @@ if (textBox.Enabled == false) image = Disabled; - TextBoxCache c = GetTextBoxCache(textBox); - Point location = textBox.PointToScreen(new Point(0, 0)); - Size size = (Size)c.DisplaySize; + Size size = (Size)DisplaySize; DrawStretchImage(location, size, image, StretchRegion); @@ -173,13 +178,13 @@ location.Y += StretchRegion.Y; - if (c == null || c.TextBoxSurface == null) + if (TextBoxSurface == null) { WidgetFont.DrawText(location, textBox.Text); } else { - c.TextBoxSurface.Draw(location); + TextBoxSurface.Draw(location); } if (textBox.HasFocus) @@ -195,11 +200,9 @@ private int TextBoxClientToTextLocation(TextBox textBox, Point clientLocation) { - TextBoxCache c = GetTextBoxCache(textBox); + clientLocation.X += Origin.X - StretchRegion.X; + clientLocation.Y += Origin.Y - StretchRegion.Y; - clientLocation.X += c.Origin.X - StretchRegion.X; - clientLocation.Y += c.Origin.Y - StretchRegion.Y; - Size sz = Size.Empty; int last = 0; int index; @@ -283,14 +286,9 @@ sz.Width + StretchRegion.X, lines * WidgetFont.FontHeight + StretchRegion.Y); - TextBoxCache c = textBox.Cache as TextBoxCache; + loc.X -= Origin.X; + loc.Y -= Origin.Y; - if (c != null) - { - loc.X -= c.Origin.X; - loc.Y -= c.Origin.Y; - } - loc.Y++; return loc; Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWidget.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWidget.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWidget.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -22,22 +22,27 @@ using System.Text; using AgateLib.DisplayLib; using AgateLib.Geometry; -using AgateLib.Gui.Cache; namespace AgateLib.Gui.ThemeEngines.Mercury { /// <summary> /// Base class for classes which draw widgets for the Mercury theme engine. /// </summary> - public abstract class MercuryWidget + public abstract class MercuryWidget : WidgetRenderer { MercuryScheme scheme; + Widget mWidget; - public MercuryWidget(MercuryScheme scheme) + public MercuryWidget(MercuryScheme scheme, Widget widget) { this.scheme = scheme; + this.mWidget = widget; + //DisplayLocation = (PointF)widget.Location; + //DisplaySize = (SizeF)widget.Size; } + protected Widget widget { get { return mWidget; } } + public int Margin { get; set; } public MercuryScheme Scheme { @@ -133,7 +138,6 @@ { return new Size(int.MaxValue / 2, int.MaxValue / 2); } - public abstract void DrawWidget(Widget w); public virtual bool HitTest(Widget w, Point clientLocation) { return true; @@ -162,22 +166,20 @@ const float transitionSpeed = 2; internal void DoTransition(Widget widget) { - var c = GetOrCreateCache(widget); - - if (Math.Abs(widget.Width - c.DisplayWidth) > 0) + if (Math.Abs(widget.Width - DisplayWidth) > 0) { - c.DisplayWidth += UpdateAmount(widget.Width, c.DisplayWidth ); + DisplayWidth += UpdateAmount(widget.Width, DisplayWidth ); } - if (Math.Abs(widget.Height - c.DisplayHeight) > 0) + if (Math.Abs(widget.Height - DisplayHeight) > 0) { - c.DisplayHeight += UpdateAmount(widget.Height, c.DisplayHeight); + DisplayHeight += UpdateAmount(widget.Height, DisplayHeight); } - if (Math.Abs(widget.Location.X - c.DisplayLocation.X) > 0 || - Math.Abs(widget.Location.Y - c.DisplayLocation.Y) > 0) + if (Math.Abs(widget.Location.X - DisplayLocation.X) > 0 || + Math.Abs(widget.Location.Y - DisplayLocation.Y) > 0) { - c.DisplayLocation = new PointF( - c.DisplayLocation.X + UpdateAmount(widget.Location.X, c.DisplayLocation.X), - c.DisplayLocation.Y + UpdateAmount(widget.Location.Y, c.DisplayLocation.Y)); + DisplayLocation = new PointF( + DisplayLocation.X + UpdateAmount(widget.Location.X, DisplayLocation.X), + DisplayLocation.Y + UpdateAmount(widget.Location.Y, DisplayLocation.Y)); } } @@ -186,19 +188,5 @@ return (float)((target - current) * Display.DeltaTime * transitionSpeed / 1000.0); } - public virtual WidgetCache GetOrCreateCache(Widget w) - { - var retval = new WidgetCache(); - - InitializeCache(w, retval); - - return retval; - } - - protected void InitializeCache(Widget widget, WidgetCache c) - { - c.DisplayLocation = (PointF)widget.Location; - c.DisplaySize = (SizeF)widget.Size; - } } } Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWindow.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWindow.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWindow.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -45,9 +45,28 @@ public int DropShadowSize { get; set; } - public MercuryWindow(MercuryScheme scheme) : base(scheme) + public MercuryWindow(MercuryScheme scheme, Widget widget) + : base(scheme, widget) { CenterTitle = true; + + if (scheme.Window != null) + { + NoTitle = scheme.Window.NoTitle; + WithTitle = scheme.Window.WithTitle; + TitleBar = scheme.Window.TitleBar; + NoTitleStretchRegion = scheme.Window.NoTitleStretchRegion; + WithTitleStretchRegion = scheme.Window.WithTitleStretchRegion; + TitleBarStretchRegion = scheme.Window.TitleBarStretchRegion; + + CenterTitle = scheme.Window.CenterTitle; + + CloseButton = scheme.Window.CloseButton; + CloseButtonHover = scheme.Window.CloseButtonHover; + CloseButtonInactive = scheme.Window.CloseButtonInactive; + + DropShadowSize = scheme.Window.DropShadowSize; + } } public override void DrawWidget(Widget w) @@ -57,8 +76,12 @@ public void DrawWindow(Window window) { DrawWindowBackground(window); - DrawWindowTitle(window); - DrawWindowDecorations(window); + + if (window.ShowTitleBar) + { + DrawWindowTitle(window); + DrawWindowDecorations(window); + } } // TODO: fix this @@ -77,7 +100,10 @@ } else - throw new NotImplementedException(); + DrawStretchImage(window.Parent.PointToScreen( + new Point(window.Location.X, window.Location.Y)), + window.Size, NoTitle, NoTitleStretchRegion); + } private void DrawDropShadow(Rectangle rect) @@ -146,7 +172,11 @@ } else { - throw new NotImplementedException(); + return new Rectangle( + NoTitleStretchRegion.Left, + NoTitleStretchRegion.Top, + widget.Width - (NoTitle.SurfaceWidth - NoTitleStretchRegion.Width), + widget.Height - (NoTitle.SurfaceHeight - NoTitleStretchRegion.Height)); } } Added: trunk/AgateLib/Gui/ThemeEngines/Venus/CssData.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/CssData.cs (rev 0) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/CssData.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace AgateLib.Gui.ThemeEngines.Venus +{ + public class CssData + { + List<CssInfo> infos = new List<CssInfo>(); + + public void Parse(string text) + { + if (text == null) + throw new InvalidOperationException("Text must be set before calling Parse."); + + int position = 0; + int openBrace; + + while ((openBrace = text.IndexOf('{', position)) >= 0) + { + string obj = text.Substring(position, openBrace - position); + + int endBrace = text.IndexOf('}', openBrace); + + if (endBrace == -1) + { + throw new InvalidDataException("Open brace was not matched by close brace."); + } + + string contents = text.Substring(openBrace + 1, endBrace - openBrace - 2); + + infos.Add(ParseCssContents(obj, contents)); + position = endBrace + 1; + } + } + + CssInfo ParseCssContents (string obj, string contents) + { + CssInfo retval = new CssInfo(); + + retval.ClassName = obj.Trim(); + + string[] args = contents.Split(';'); + + foreach (string arg in args) + { + int colon = arg.IndexOf(':'); + + if (colon == -1) + continue; + + retval.AddProperty(arg.Substring(0, colon), arg.Substring(colon + 1)); + } + + return retval; + } + + } + public class CssInfo + { + public string ClassName { get; set; } + Dictionary<string, string> mProperties = new Dictionary<string, string>(); + + public void AddProperty(string name, string value) + { + name = name.ToLowerInvariant().Trim(); + value = value.Trim(); + + if (mProperties.ContainsKey(name)) + mProperties.Remove(name); + + mProperties.Add(name, value); + } + + public Dictionary<string,string> Properties + { + get { return mProperties; } + } + } +} Added: trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs (rev 0) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/Venus.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.Geometry; + +namespace AgateLib.Gui.ThemeEngines.Venus +{ + public class Venus : IGuiThemeEngine + { + #region IGuiThemeEngine Members + + public void DrawWidget(Widget widget) + { + throw new NotImplementedException(); + } + + public Size CalcMinSize(Widget widget) + { + throw new NotImplementedException(); + } + + public Size CalcMaxSize(Widget widget) + { + throw new NotImplementedException(); + } + + public int ThemeMargin(Widget widget) + { + throw new NotImplementedException(); + } + + public Rectangle GetClientArea(Container widget) + { + throw new NotImplementedException(); + } + + public Size RequestClientAreaSize(Container widget, Size clientSize) + { + throw new NotImplementedException(); + } + + public bool HitTest(Widget widget, Point screenLocation) + { + throw new NotImplementedException(); + } + + public void Update(GuiRoot guiRoot) + { + throw new NotImplementedException(); + } + + public void MouseDownInWidget(Widget widget, Point clientLocation) + { + throw new NotImplementedException(); + } + + public void MouseMoveInWidget(Widget widget, Point clientLocation) + { + throw new NotImplementedException(); + } + + public void MouseUpInWidget(Widget widget, Point clientLocation) + { + throw new NotImplementedException(); + } + + public void WidgetNeedsUpdate(Widget widget) + { + throw new NotImplementedException(); + } + + #endregion + + #region IGuiThemeEngine Members + + + public WidgetRenderer CreateRenderer(Widget widget) + { + throw new NotImplementedException(); + } + + #endregion + } +} Added: trunk/AgateLib/Gui/ThemeEngines/Venus/VenusScheme.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/VenusScheme.cs (rev 0) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/VenusScheme.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.Gui.ThemeEngines.Venus +{ + public class VenusScheme + { + Dictionary<string, string> mAdditionalProperties = new Dictionary<string, string>(); + + + } +} Added: trunk/AgateLib/Gui/ThemeEngines/Venus/VenusTheme.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/VenusTheme.cs (rev 0) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/VenusTheme.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.Gui.ThemeEngines.Venus +{ + public class VenusTheme + { + } +} Added: trunk/AgateLib/Gui/ThemeEngines/Venus/VenusThemeDictionary.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/VenusThemeDictionary.cs (rev 0) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/VenusThemeDictionary.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.Gui.ThemeEngines.Venus +{ + public class VenusThemeDictionary : Dictionary<string, VenusTheme> + { + + } +} Added: trunk/AgateLib/Gui/ThemeEngines/Venus/WidgetStyle.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Venus/WidgetStyle.cs (rev 0) +++ trunk/AgateLib/Gui/ThemeEngines/Venus/WidgetStyle.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.Gui.ThemeEngines.Venus +{ + public class WidgetStyle + { + Dictionary<string, string> mProperties = new Dictionary<string, string>(); + + + } +} Modified: trunk/AgateLib/Gui/Widget.cs =================================================================== --- trunk/AgateLib/Gui/Widget.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Gui/Widget.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -83,7 +83,7 @@ /// <summary> /// Returns the WidgetCache object used by the theming engine. /// </summary> - public Cache.WidgetCache Cache { get; set; } + public WidgetRenderer Cache { get; set; } /// <summary> /// Gets whether or not this widget can have keyboard focus. @@ -166,8 +166,24 @@ /// </summary> protected virtual void OnParentChanged() { + CreateRendererIfNecessary(); + RecalcSizeRange(); } + + private void CreateRendererIfNecessary() + { + if (Root == null) return; + if (Root.ThemeEngine == null) return; + if (Cache != null) return; + + RecreateRenderer(); + } + + public virtual void RecreateRenderer() + { + Cache = Root.ThemeEngine.CreateRenderer(this); + } /// <summary> /// Called when this control should recalculate its minimum and maximum size values. /// </summary> @@ -272,6 +288,11 @@ } /// <summary> + /// Gets or sets any custom data associated with this control. You may use + /// this field to store whatever data you like. + /// </summary> + public object Tag { get; set; } + /// <summary> /// Gets the width of this widget. /// </summary> public int Width @@ -429,7 +450,8 @@ /// </summary> protected virtual void DoDraw() { - Root.ThemeEngine.DrawWidget(this); + //Root.ThemeEngine.DrawWidget(this); + Cache.DrawWidget(this); } protected internal virtual void UpdateGui() Added: trunk/AgateLib/Gui/WidgetRenderer.cs =================================================================== --- trunk/AgateLib/Gui/WidgetRenderer.cs (rev 0) +++ trunk/AgateLib/Gui/WidgetRenderer.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,77 @@ +// The contents of this file are subject to the Mozilla Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is AgateLib. +// +// The Initial Developer of the Original Code is Erik Ylvisaker. +// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009. +// All Rights Reserved. +// +// Contributor(s): Erik Ylvisaker +// +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.Geometry; + +namespace AgateLib.Gui +{ + /// <summary> + /// Base class for a cache object used by widgets. + /// </summary> + public abstract class WidgetRenderer + { + RectangleF mDisplayRect; + + /// <summary> + /// Constructs a widget cache object. + /// </summary> + public WidgetRenderer() + { + Dirty = true; + } + + public abstract void DrawWidget(Widget w); + + /// <summary> + /// Indicates whether or not the cache is dirty and needs to be recalculated. + /// </summary> + public bool Dirty { get; set; } + + public RectangleF DisplayRect { get{return mDisplayRect; } + set { mDisplayRect = value; } + } + public SizeF DisplaySize + { + get { return mDisplayRect.Size; } + set { mDisplayRect.Size = value; } + } + public PointF DisplayLocation + { + get { return mDisplayRect.Location; } + set { mDisplayRect.Location = value; } + } + + public float DisplayWidth + { + get { return mDisplayRect.Width; } + set { mDisplayRect.Width = value; } + } + public float DisplayHeight + { + get { return mDisplayRect.Height; } + set { mDisplayRect.Height = value; } + } + + public bool DisplayVisible { get; set; } + public float DisplayAlpha { get; set; } + } +} Modified: trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs =================================================================== --- trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -390,7 +390,7 @@ byte[] buffer = ms.GetBuffer(); string newValue = Convert.ToBase64String( - buffer, Base64FormattingOptions.InsertLineBreaks); + buffer/*, Base64FormattingOptions.InsertLineBreaks*/); XmlElement el = WriteAsElement(name, newValue); AddAttribute(el, "stream", "true"); Added: trunk/Tests/Data/CssTest.css =================================================================== --- trunk/Tests/Data/CssTest.css (rev 0) +++ trunk/Tests/Data/CssTest.css 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,7 @@ + +window +{ + background-image: url('test.png'); + background-color: #000000; + background-repeat: no-repeat; +} \ No newline at end of file Added: trunk/Tests/GuiTests/CssParserTest.cs =================================================================== --- trunk/Tests/GuiTests/CssParserTest.cs (rev 0) +++ trunk/Tests/GuiTests/CssParserTest.cs 2010-02-18 22:34:23 UTC (rev 1234) @@ -0,0 +1,30 @@ +using System; +using AgateLib.Gui.ThemeEngines.Venus; + +namespace Tests +{ + public class CssParserTest : IAgateTest + { + #region IAgateTest implementation + + public void Main(string[] args) + { + CssData p = new CssData(); + + p.Parse(System.IO.File.ReadAllText("Data/CssTest.css")); + + } + + public string Name + { + get { return "Css Parser"; } + } + + public string Category + { + get { return "Gui"; } + } + + #endregion + } +} Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2010-02-12 03:40:11 UTC (rev 1233) +++ trunk/Tests/Tests.csproj 2010-02-18 22:34:23 UTC (rev 1234) @@ -1,4 +1,5 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> <ProductVersion>9.0.30729</ProductVersion> @@ -6,8 +7,6 @@ <ProjectGuid>{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon> - </ApplicationIcon> <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>Tests</AssemblyName> @@ -25,44 +24,35 @@ </FileUpgradeFlags> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <AllowUnsafeBlocks>False</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> - <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE;</DefineConstants> <DocumentationFile> </DocumentationFile> - <DebugSymbols>True</DebugSymbols> + <DebugSymbols>true</DebugSymbols> <FileAlignment>4096</FileAlignment> - <Optimize>False</Optimize> + <Optimize>false</Optimize> <OutputPath>..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> - <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn> - </NoWarn> + <DebugType>full</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <AllowUnsafeBlocks>False</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> - <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE;</DefineConstants> <DocumentationFile> </DocumentationFile> - <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> - <Optimize>True</Optimize> + <Optimize>true</Optimize> <OutputPath>..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> - <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn> - </NoWarn> + <DebugType>none</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> @@ -71,6 +61,9 @@ <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> <PlatformTarget>x64</PlatformTarget> + <DebugType>full</DebugType> + <WarningLevel>4</WarningLevel> + <Optimize>false</Optimize> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> <OutputPath>bin\x64\Release\</OutputPath> @@ -79,6 +72,8 @@ <Optimize>true</Optimize> <FileAlignment>4096</FileAlignment> <PlatformTarget>x64</PlatformTarget> + <DebugType>none</DebugType> + <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> @@ -87,6 +82,9 @@ <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> <PlatformTarget>x86</PlatformTarget> + <DebugType>full</DebugType> + <WarningLevel>4</WarningLevel> + <Optimize>false</Optimize> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <OutputPath>bin\x86\Release\</OutputPath> @@ -95,6 +93,8 @@ <Optimize>true</Optimize> <FileAlignment>4096</FileAlignment> <PlatformTarget>x86</PlatformTarget> + <DebugType>none</DebugType> + <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="System"> @@ -146,7 +146,6 @@ <DependentUpon>frmLauncher.cs</DependentUpon> <SubType>Code</SubType> </Compile> - <Compile Include="GuiTests\Transitions.cs" /> <Compile Include="GuiTests\Listboxes.cs" /> <Compile Include="GuiTests\RenderGui.cs" /> <Compile Include="GuiTests\ScrollBars.cs" /> @@ -506,6 +505,10 @@ <None Include="Data\shaders\hlsl\PerPixelLighting.fx"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> + <Compile Include="GuiTests\CssParserTest.cs" /> + <None Include="Data\CssTest.css"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> </ItemGroup> <ItemGroup> <ProjectReference Include="..\AgateLib\AgateLib.csproj"> @@ -517,7 +520,7 @@ <Name>AgateLib.WinForms</Name> </ProjectReference> </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PreBuildEvent> </PreBuildEvent> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-12 03:40:21
|
Revision: 1233 http://agate.svn.sourceforge.net/agate/?rev=1233&view=rev Author: kanato Date: 2010-02-12 03:40:11 +0000 (Fri, 12 Feb 2010) Log Message: ----------- Replace XNA flags with XBOX360 flags in some places. Implement XnaDisplay and XnaDisplayWindow. Modified Paths: -------------- branches/xna/AgateLib/AgateException.cs branches/xna/AgateLib/AgateFileProvider.cs branches/xna/AgateLib/AgateLib.csproj branches/xna/AgateLib/AgateLibXbox.csproj branches/xna/AgateLib/AgateLibXna.csproj branches/xna/AgateLib/CompatibilityExtensions/Enums.cs branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs branches/xna/AgateLib/Core.cs branches/xna/AgateLib/Data/AgateDatabaseException.cs branches/xna/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs branches/xna/AgateLib/Drivers/Registrar.cs branches/xna/AgateLib/Geometry/TypeConverters.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs branches/xna/AgateLib/Gui/AgateGuiException.cs branches/xna/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs branches/xna/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs branches/xna/AgateLib/Meshes/Loaders/Obj/Parser.cs branches/xna/AgateLib/PlatformType.cs branches/xna/AgateLib/Properties/AssemblyInfo.cs branches/xna/AgateLib/Resources/AgateResourceException.cs branches/xna/AgateLib/Serialization/Formatters/Xml/XmlFormatter.cs branches/xna/AgateLib/Serialization/Xle/TypeBinder.cs branches/xna/AgateLib/Serialization/Xle/XleSerializationException.cs branches/xna/AgateLib/Serialization/Xle/XleSerializationInfo.cs branches/xna/AgateLib/Utility/FileSystemProvider.cs branches/xna/AgateLib/Utility/Platform.cs branches/xna/AgateXbox.sln Added Paths: ----------- branches/xna/AgateLib/Xna/ branches/xna/AgateLib/Xna/Shaders/ branches/xna/AgateLib/Xna/Shaders/XnaBasic2D.cs branches/xna/AgateLib/Xna/XnaDisplay.cs branches/xna/AgateLib/Xna/XnaDisplayFrameBuffer.cs branches/xna/AgateLib/Xna/XnaDisplayWindow.cs branches/xna/TestXna/ branches/xna/TestXna/Game.ico branches/xna/TestXna/GameThumbnail.png branches/xna/TestXna/Program.cs branches/xna/TestXna/Properties/ branches/xna/TestXna/Properties/AssemblyInfo.cs branches/xna/TestXna/TestXna.csproj branches/xna/TestXna/TestXnaXbox.csproj Modified: branches/xna/AgateLib/AgateException.cs =================================================================== --- branches/xna/AgateLib/AgateException.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/AgateException.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -58,7 +58,7 @@ public AgateException(Exception inner, string format, params object[] args) : base(string.Format(format, args), inner) { } -#if !XBOX360 +#if !XNA /// <summary> /// Deserializes an AgateException. /// </summary> @@ -96,7 +96,7 @@ /// Constructs a new AgateCrossPlatformException object. /// </summary> public AgateCrossPlatformException(string message, Exception inner) : base(message, inner) { } -#if !XBOX360 +#if !XNA /// <summary> /// Constructs a new AgateCrossPlatformException object from serialization data. /// </summary> Modified: branches/xna/AgateLib/AgateFileProvider.cs =================================================================== --- branches/xna/AgateLib/AgateFileProvider.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/AgateFileProvider.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -44,7 +44,7 @@ static void Initialize() { -#if !XBOX360 +#if !XNA string location = System.Reflection.Assembly.GetEntryAssembly().Location; mAssemblyProvider.Add(new FileSystemProvider(Path.GetDirectoryName(location))); @@ -93,7 +93,7 @@ get { return mResourceProvider; } } -#if !XBOX360 +#if !XNA /// <summary> /// Saves a stream to a file in the temp path. /// </summary> Modified: branches/xna/AgateLib/AgateLib.csproj =================================================================== --- branches/xna/AgateLib/AgateLib.csproj 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/AgateLib.csproj 2010-02-12 03:40:11 UTC (rev 1233) @@ -140,6 +140,7 @@ <Compile Include="AudioLib\SoundFormat.cs" /> <Compile Include="AudioLib\StreamingSoundBuffer.cs" /> <Compile Include="CompatibilityExtensions\Enums.cs" /> + <Compile Include="CompatibilityExtensions\FakeAttributes.cs" /> <Compile Include="CompatibilityExtensions\Numerics.cs" /> <Compile Include="CompatibilityExtensions\XboxExtensions.cs" /> <Compile Include="Core.cs"> Modified: branches/xna/AgateLib/AgateLibXbox.csproj =================================================================== --- branches/xna/AgateLib/AgateLibXbox.csproj 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/AgateLibXbox.csproj 2010-02-12 03:40:11 UTC (rev 1233) @@ -18,7 +18,7 @@ <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Xbox 360\Debug</OutputPath> - <DefineConstants>DEBUG;TRACE;XBOX;XBOX360</DefineConstants> + <DefineConstants>TRACE;DEBUG;XBOX;XBOX360;XNA</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <NoStdLib>true</NoStdLib> @@ -30,7 +30,7 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Xbox 360\Release</OutputPath> - <DefineConstants>TRACE;XBOX;XBOX360</DefineConstants> + <DefineConstants>TRACE;XBOX;XBOX360;XNA</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <NoStdLib>true</NoStdLib> @@ -282,6 +282,10 @@ <Compile Include="Utility\TgzFileProvider.cs" /> <Compile Include="Utility\ZipFileProvider.cs" /> <Compile Include="CompatibilityExtensions\XboxExtensions.cs" /> + <Compile Include="Xna\Shaders\XnaBasic2D.cs" /> + <Compile Include="Xna\XnaDisplay.cs" /> + <Compile Include="Xna\XnaDisplayFrameBuffer.cs" /> + <Compile Include="Xna\XnaDisplayWindow.cs" /> </ItemGroup> <ItemGroup> <NestedContentProject Include="Content\Content.contentproj"> Modified: branches/xna/AgateLib/AgateLibXna.csproj =================================================================== --- branches/xna/AgateLib/AgateLibXna.csproj 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/AgateLibXna.csproj 2010-02-12 03:40:11 UTC (rev 1233) @@ -6,8 +6,8 @@ <Platform Condition=" '$(Platform)' == '' ">x86</Platform> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>AgateLibXna</RootNamespace> - <AssemblyName>AgateLibXna</AssemblyName> + <RootNamespace>AgateLib</RootNamespace> + <AssemblyName>AgateLib</AssemblyName> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <XnaFrameworkVersion>v3.1</XnaFrameworkVersion> <XnaPlatform>Windows</XnaPlatform> @@ -33,7 +33,7 @@ <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\x86\Debug</OutputPath> - <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants> + <DefineConstants>TRACE;DEBUG;WINDOWS;XNA</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <NoStdLib>true</NoStdLib> @@ -46,7 +46,7 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\x86\Release</OutputPath> - <DefineConstants>TRACE;WINDOWS</DefineConstants> + <DefineConstants>TRACE;WINDOWS;XNA</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <NoStdLib>true</NoStdLib> @@ -70,6 +70,9 @@ <Reference Include="System"> <Private>False</Private> </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml"> <Private>False</Private> </Reference> @@ -301,6 +304,10 @@ <Compile Include="Utility\SurfacePacker.cs" /> <Compile Include="Utility\TgzFileProvider.cs" /> <Compile Include="Utility\ZipFileProvider.cs" /> + <Compile Include="Xna\Shaders\XnaBasic2D.cs" /> + <Compile Include="Xna\XnaDisplay.cs" /> + <Compile Include="Xna\XnaDisplayFrameBuffer.cs" /> + <Compile Include="Xna\XnaDisplayWindow.cs" /> </ItemGroup> <ItemGroup> <NestedContentProject Include="Content\Content.contentproj"> Modified: branches/xna/AgateLib/CompatibilityExtensions/Enums.cs =================================================================== --- branches/xna/AgateLib/CompatibilityExtensions/Enums.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/CompatibilityExtensions/Enums.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ { public static Array GetValues(Type enumType) { -#if XBOX360 +#if XNA if (enumType.IsEnum == false) throw new AgateException("You must pass an enumeration type."); Modified: branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs =================================================================== --- branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -3,13 +3,15 @@ using System.Linq; using System.Text; +#if XNA + +// The attributes in this file are "fake" replacements for those +// found in the System.ComponentModel namespace. These allow the same +// code to compile for Windows and Xbox and take advantage of those attributes +// without having a metric ton of #if statements everywhere. + namespace System.ComponentModel { - // The attributes in this file are "fake" replacements for those - // found in the System.ComponentModel namespace. These allow the same - // code to compile for Windows and Xbox and take advantage of those attributes - // without having to have #if statements everywhere. -#if XBOX360 [global::System.AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)] sealed class BrowsableAttribute : Attribute { @@ -27,5 +29,6 @@ class ExpandableObjectConverter { } +} + #endif -} \ No newline at end of file Modified: branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs =================================================================== --- branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ { public static bool TryParseInt32(string str, out int value) { -#if XBOX360 +#if XNA value = 0; try @@ -28,7 +28,7 @@ } public static bool TryParseInt32(string str, NumberStyles style, IFormatProvider provider, out int value) { -#if XBOX360 +#if XNA throw new NotImplementedException(); #else return int.TryParse(str, style, provider, out value); Modified: branches/xna/AgateLib/Core.cs =================================================================== --- branches/xna/AgateLib/Core.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Core.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -300,10 +300,10 @@ static Core() { -#if !XBOX360 +#if !XNA mPlatform = new Utility.Platform(); #else - mPlatform = new Utility.XBox360Platform(); + mPlatform = new Utility.XNAPlatform(); #endif } /// <summary> @@ -422,7 +422,7 @@ InputLib.JoystickInput.PollTimer(); } -#if !XBOX360 +#if !XNA /// <summary> /// Returns the directory the application that was started resides in. /// </summary> Modified: branches/xna/AgateLib/Data/AgateDatabaseException.cs =================================================================== --- branches/xna/AgateLib/Data/AgateDatabaseException.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Data/AgateDatabaseException.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -65,7 +65,7 @@ ErrorCount = errorCount; } -#if !XBOX360 +#if !XNA /// <summary> /// Constructs a database exception. /// </summary> Modified: branches/xna/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs =================================================================== --- branches/xna/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -226,9 +226,7 @@ } /// <summary> - /// A version of EndFrame must be called at the end of each frame. - /// This version allows the caller to indicate to the implementation whether or - /// not it is preferred to wait for the vertical blank to do the drawing. + /// EndFrame must be called at the end of each frame. /// </summary> public void EndFrame() { Modified: branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs =================================================================== --- branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -49,7 +49,7 @@ /// </summary> public AgateShaderCompilerException(string message, Exception inner) : base(message, inner) { } -#if !XBOX360 +#if !XNA /// <summary> /// Constructs an AgateShaderCompilerException object. /// </summary> Modified: branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs =================================================================== --- branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -24,7 +24,7 @@ namespace AgateLib.Drivers { -#if !XBOX360 +#if !XNA class AgateSandBoxLoader : MarshalByRefObject { public AgateDriverInfo[] ReportDrivers(string file) Modified: branches/xna/AgateLib/Drivers/Registrar.cs =================================================================== --- branches/xna/AgateLib/Drivers/Registrar.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Drivers/Registrar.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -71,9 +71,6 @@ return info.DriverType == driverType && info.DriverTypeID == type; } - static Registrar() - { - } /// <summary> /// Searches through FileManager.AssemblyPath for all *.dll files. These files /// are loaded and searched for classes which derive from DisplayImpl, AudioImpl, etc. @@ -83,7 +80,7 @@ if (mIsInitialized) return; -#if !XBOX360 +#if !XNA RegisterNullDrivers(); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); @@ -139,7 +136,7 @@ #endif } -#if !XBOX360 +#if !XNA private static void SortDriverInfo(List<AgateDriverInfo> driverList) { // sorts the driver list in reverse order. @@ -274,6 +271,7 @@ } + private static void SelectBestDrivers(bool chooseDisplay, bool chooseAudio, bool chooseInput, DisplayTypeID preferredDisplay, AudioTypeID preferredAudio, InputTypeID preferredInput, out DisplayTypeID selectedDisplay, out AudioTypeID selectedAudio, out InputTypeID selectedInput) @@ -314,6 +312,9 @@ internal static DisplayImpl CreateDisplayDriver(DisplayTypeID displayType) { +#if XNA + return new AgateLib.Xna.XnaDisplay(); +#endif if (displayDrivers.Count == 0) throw new AgateException("No display drivers registered."); @@ -399,7 +400,7 @@ return Activator.CreateInstance(driverType); } -#if !XBOX360 +#if !XNA private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { AgateDriverInfo info = null; Modified: branches/xna/AgateLib/Geometry/TypeConverters.cs =================================================================== --- branches/xna/AgateLib/Geometry/TypeConverters.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Geometry/TypeConverters.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -38,11 +38,11 @@ /// <param name="str"></param> /// <returns></returns> public -#if !XBOX360 +#if !XNA new #endif static Point ConvertFromString( -#if XBOX360 +#if XNA object unusued, #else ITypeDescriptorContext context, @@ -80,7 +80,7 @@ } } -#if !XBOX360 +#if !XNA /// <summary> /// @@ -132,11 +132,11 @@ /// <param name="str"></param> /// <returns></returns> public -#if !XBOX360 +#if !XNA new #endif static Size ConvertFromString( -#if XBOX360 +#if XNA object unusued, #else ITypeDescriptorContext context, @@ -183,7 +183,7 @@ return retval; } -#if !XBOX360 +#if !XNA /// <summary> /// /// </summary> @@ -229,11 +229,11 @@ /// <param name="str"></param> /// <returns></returns> public -#if !XBOX360 +#if !XNA new #endif static Rectangle ConvertFromString( -#if XBOX360 +#if XNA object unusued, #else ITypeDescriptorContext context, @@ -294,7 +294,7 @@ int value = int.Parse(text.Substring(equals + 1), System.Globalization.CultureInfo.CurrentCulture); return value; } -#if !XBOX360 +#if !XNA /// <summary> /// /// </summary> Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ /// Vertex layout which only contains position and color information. /// </summary> [StructLayout(LayoutKind.Sequential -#if !XBOX360 +#if !XNA , Pack = 1 #endif )] Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ /// Vertex structure with position, texture and color values /// </summary> [StructLayout(LayoutKind.Sequential -#if !XBOX360 +#if !XNA , Pack = 1 #endif )] Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ /// Vertex structure with position, texture and normal values. /// </summary> [StructLayout(LayoutKind.Sequential -#if !XBOX360 +#if !XNA , Pack = 1 #endif )] Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ /// Vertex structure with position, texture coordinates, normal, tangent, bitangent. /// </summary> [StructLayout(LayoutKind.Sequential -#if !XBOX360 +#if !XNA , Pack = 1 #endif )] Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ /// Vertex structure with position, texture and normal values. /// </summary> [StructLayout(LayoutKind.Sequential -#if !XBOX360 +#if !XNA , Pack = 1 #endif )] Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -10,7 +10,7 @@ /// Vertex structure with position, texture coordinates, normal and tangent. /// </summary> [StructLayout(LayoutKind.Sequential -#if !XBOX360 +#if !XNA , Pack = 1 #endif )] Modified: branches/xna/AgateLib/Gui/AgateGuiException.cs =================================================================== --- branches/xna/AgateLib/Gui/AgateGuiException.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Gui/AgateGuiException.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -45,7 +45,7 @@ /// <param name="message"></param> /// <param name="inner"></param> public AgateGuiException(string message, Exception inner) : base(message, inner) { } -#if !XBOX360 +#if !XNA /// <summary> /// Constructs a new AgateGuiException. /// </summary> Modified: branches/xna/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs =================================================================== (Binary files differ) Modified: branches/xna/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs =================================================================== (Binary files differ) Modified: branches/xna/AgateLib/Meshes/Loaders/Obj/Parser.cs =================================================================== (Binary files differ) Modified: branches/xna/AgateLib/PlatformType.cs =================================================================== --- branches/xna/AgateLib/PlatformType.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/PlatformType.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -49,7 +49,7 @@ /// <summary> /// Microsoft's XBox 360 console. /// </summary> - XBox360, + XNA, /// <summary> /// The portable GP2x handheld, or compatible. /// </summary> Modified: branches/xna/AgateLib/Properties/AssemblyInfo.cs =================================================================== --- branches/xna/AgateLib/Properties/AssemblyInfo.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Properties/AssemblyInfo.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -36,7 +36,7 @@ [assembly: CLSCompliant(true)] -#if XBOX360 +#if XNA // Setting ComVisible to false makes the types in this assembly not visible // to COM components. Xbox 360 assemblies do not support COM. @@ -66,7 +66,7 @@ // Revision // [assembly: AssemblyVersion("0.3.9.0")] -#if !XBOX360 +#if !XNA [assembly: AssemblyFileVersion("0.3.9.0")] #endif [assembly: NeutralResourcesLanguageAttribute("en")] Modified: branches/xna/AgateLib/Resources/AgateResourceException.cs =================================================================== --- branches/xna/AgateLib/Resources/AgateResourceException.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Resources/AgateResourceException.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -51,7 +51,7 @@ /// <param name="message"></param> /// <param name="inner"></param> public AgateResourceException(string message, Exception inner) : base(inner, message) { } -#if !XBOX360 +#if !XNA /// <summary> /// /// </summary> Modified: branches/xna/AgateLib/Serialization/Formatters/Xml/XmlFormatter.cs =================================================================== --- branches/xna/AgateLib/Serialization/Formatters/Xml/XmlFormatter.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Serialization/Formatters/Xml/XmlFormatter.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -55,7 +55,7 @@ namespace AgateLib.Serialization.Formatters.Xml { -#if !XBOX360 +#if !XNA /// <summary> /// The <see cref="XmlFormatter"/> class implements a custom XmlFormatter /// which uses the <see cref="ISerializable"/> interace. Modified: branches/xna/AgateLib/Serialization/Xle/TypeBinder.cs =================================================================== --- branches/xna/AgateLib/Serialization/Xle/TypeBinder.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Serialization/Xle/TypeBinder.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -50,7 +50,7 @@ SearchAssemblies.Add(assembly); -#if !XBOX360 +#if !XNA // add names of assemblies referenced by the current assembly. Assembly[] loaded = AppDomain.CurrentDomain.GetAssemblies(); Modified: branches/xna/AgateLib/Serialization/Xle/XleSerializationException.cs =================================================================== --- branches/xna/AgateLib/Serialization/Xle/XleSerializationException.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Serialization/Xle/XleSerializationException.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -38,7 +38,7 @@ internal XleSerializationException() { } internal XleSerializationException(string message) : base(message) { } internal XleSerializationException(string message, Exception inner) : base(message, inner) { } -#if !XBOX360 +#if !XNA /// <summary> /// Constructs an XleSerializationException object when deserializing it. /// </summary> Modified: branches/xna/AgateLib/Serialization/Xle/XleSerializationInfo.cs =================================================================== --- branches/xna/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -390,7 +390,7 @@ byte[] buffer = ms.GetBuffer(); string newValue = Convert.ToBase64String(buffer -#if !XBOX360 +#if !XNA , Base64FormattingOptions.InsertLineBreaks #endif ); @@ -409,7 +409,7 @@ public void Write(string name, byte[] value) { string newValue = Convert.ToBase64String(value -#if !XBOX360 +#if !XNA , Base64FormattingOptions.InsertLineBreaks #endif ); Modified: branches/xna/AgateLib/Utility/FileSystemProvider.cs =================================================================== --- branches/xna/AgateLib/Utility/FileSystemProvider.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Utility/FileSystemProvider.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -165,13 +165,13 @@ /// <summary> /// Checks to see if a filepath is entered in a cross-platform /// manner, and returns true if it is. - /// When running on the Xbox360 this always returns true. + /// When running on the XNA this always returns true. /// </summary> /// <param name="path">The path to check.</param> /// <returns>True if the passed path is cross-platform.</returns> private static bool CheckCrossPlatformFilename(string path) { -#if !XBOX360 +#if !XNA if (path.Contains(Path.GetTempPath())) return true; Modified: branches/xna/AgateLib/Utility/Platform.cs =================================================================== --- branches/xna/AgateLib/Utility/Platform.cs 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateLib/Utility/Platform.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -27,7 +27,7 @@ namespace AgateLib.Utility { -#if !XBOX360 +#if !XNA /// <summary> /// Class which contains known information about the platform. /// This class also contains the folders where the application should store its data, @@ -263,7 +263,7 @@ return PlatformType.MacOS; case PlatformID.Xbox: - return PlatformType.XBox360; + return PlatformType.XNA; } return PlatformType.Unknown; @@ -366,14 +366,14 @@ } #endif -#if XBOX360 +#if XNA /// <summary> /// Class which contains known information about the platform. /// This class also contains the folders where the application should store its data, /// which are automatically created from the AssemblyCompanhy and AssemblyProduct /// attributes for the assembly where the entry point for the application is. /// </summary> - public class XBox360Platform : AgateLib.IPlatform + public class XNAPlatform : AgateLib.IPlatform { #region IPlatform Members Added: branches/xna/AgateLib/Xna/Shaders/XnaBasic2D.cs =================================================================== --- branches/xna/AgateLib/Xna/Shaders/XnaBasic2D.cs (rev 0) +++ branches/xna/AgateLib/Xna/Shaders/XnaBasic2D.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,74 @@ + +#if XNA + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.DisplayLib.Shaders.Implementation; + +namespace AgateLib.Xna.Shaders +{ + class XnaBasic2D : Basic2DImpl + { + public override AgateLib.Geometry.Rectangle CoordinateSystem + { + get + { + throw new NotImplementedException(); + } + set + { + + } + } + + public override void SetTexture(AgateLib.DisplayLib.Shaders.EffectTexture tex, string variableName) + { + throw new NotImplementedException(); + } + + public override void SetVariable(string name, params float[] v) + { + throw new NotImplementedException(); + } + + public override void SetVariable(string name, params int[] v) + { + throw new NotImplementedException(); + } + + public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix) + { + throw new NotImplementedException(); + } + + public override void SetVariable(string name, AgateLib.Geometry.Color color) + { + throw new NotImplementedException(); + } + + public override int Passes + { + get { throw new NotImplementedException(); } + } + + public override void Begin() + { + } + + public override void BeginPass(int passIndex) + { + } + + public override void EndPass() + { + } + + public override void End() + { + } + } +} + +#endif \ No newline at end of file Added: branches/xna/AgateLib/Xna/XnaDisplay.cs =================================================================== --- branches/xna/AgateLib/Xna/XnaDisplay.cs (rev 0) +++ branches/xna/AgateLib/Xna/XnaDisplay.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,261 @@ + +#if XNA + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.DisplayLib; +using AgateLib.DisplayLib.ImplementationBase; +using AgateLib.Geometry; +using Microsoft.Xna.Framework.Graphics; +using Color = AgateLib.Geometry.Color; + +namespace AgateLib.Xna +{ + class XnaDisplay : DisplayImpl + { + PresentationParameters mPresentParams; + GraphicsDevice mDevice; + + public override void Initialize() + { + + } + internal void CreateWindow(CreateWindowParams p, IntPtr handle) + { + if (mDevice != null) + throw new AgateException("Cannot create more than one window."); + + mPresentParams = new PresentationParameters(); + + mPresentParams.BackBufferFormat = SurfaceFormat.Bgr32; + mPresentParams.BackBufferWidth = p.Width; + mPresentParams.BackBufferHeight = p.Height; + mPresentParams.SwapEffect = SwapEffect.Discard; + + mPresentParams.AutoDepthStencilFormat = DepthFormat.Depth24Stencil8; + mPresentParams.EnableAutoDepthStencil = true; + mPresentParams.PresentationInterval = PresentInterval.Default; + mPresentParams.PresentOptions = PresentOptions.DiscardDepthStencil; + + mPresentParams.IsFullScreen = true; + +#if !XBOX360 + mPresentParams.IsFullScreen = false; +#endif + + mDevice = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, DeviceType.Hardware, handle, mPresentParams); + } + + public override void Dispose() + { + mDevice.Dispose(); + } + + public override DisplayWindowImpl CreateDisplayWindow(CreateWindowParams windowParams) + { +#if XBOX360 + CreateWindow(windowParams, IntPtr.Zero); + return new XnaDisplayWindow(this, mDevice); +#else + System.Windows.Forms.Form form = new System.Windows.Forms.Form(); + form.ClientSize = new System.Drawing.Size(windowParams.Width, windowParams.Height); + + CreateWindow(windowParams, form.Handle); + + return new XnaDisplayWindow(this, mDevice, form); +#endif + + } + + public override SurfaceImpl CreateSurface(string fileName) + { + throw new NotImplementedException(); + } + + public override SurfaceImpl CreateSurface(System.IO.Stream fileStream) + { + throw new NotImplementedException(); + } + + public override SurfaceImpl CreateSurface(Size surfaceSize) + { + throw new NotImplementedException(); + } + + public override FontSurfaceImpl CreateFont(string fontFamily, float sizeInPoints, FontStyle style) + { + throw new NotImplementedException(); + } + + public override FontSurfaceImpl CreateFont(AgateLib.BitmapFont.BitmapFontOptions bitmapOptions) + { + throw new NotImplementedException(); + } + + + public override bool CapsBool(DisplayBoolCaps caps) + { + throw new NotImplementedException(); + } + + public override Size CapsSize(DisplaySizeCaps displaySizeCaps) + { + throw new NotImplementedException(); + } + + public override IEnumerable<AgateLib.DisplayLib.Shaders.ShaderLanguage> SupportedShaderLanguages + { + get { throw new NotImplementedException(); } + } + + public override PixelFormat DefaultSurfaceFormat + { + get { throw new NotImplementedException(); } + } + + protected override void OnRenderTargetChange(FrameBuffer oldRenderTarget) + { + + } + + protected override void OnRenderTargetResize() + { + throw new NotImplementedException(); + } + + protected override void OnBeginFrame() + { + } + + protected override void OnEndFrame() + { + mDevice.Present(); + } + + public override void SetClipRect(Rectangle newClipRect) + { + throw new NotImplementedException(); + } + + public override void Clear(Color color) + { + mDevice.Clear(Convert(color)); + } + + public override void Clear(Color color, Rectangle dest) + { + throw new NotImplementedException(); + } + + public override void FillPolygon(PointF[] pts, int startIndex, int length, Color color) + { + throw new NotImplementedException(); + } + + public override void DrawLine(Point a, Point b, Color color) + { + throw new NotImplementedException(); + } + + public override void DrawRect(Rectangle rect, Color color) + { + throw new NotImplementedException(); + } + + public override void DrawRect(RectangleF rect, Color color) + { + throw new NotImplementedException(); + } + + public override void FillRect(Rectangle rect, Color color) + { + throw new NotImplementedException(); + } + + public override void FillRect(Rectangle rect, Gradient color) + { + throw new NotImplementedException(); + } + + public override void FillRect(RectangleF rect, Color color) + { + throw new NotImplementedException(); + } + + public override void FillRect(RectangleF rect, Gradient color) + { + throw new NotImplementedException(); + } + + public override void FlushDrawBuffer() + { + } + + protected internal override void ProcessEvents() + { +#if !XBOX360 + System.Windows.Forms.Application.DoEvents(); +#endif + } + + protected internal override void ShowCursor() + { + throw new NotImplementedException(); + } + + protected internal override void HideCursor() + { + throw new NotImplementedException(); + } + + protected internal override AgateLib.DisplayLib.Shaders.Implementation.AgateShaderImpl CreateBuiltInShader(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType) + { + switch (BuiltInShaderType) + { + case AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader.Basic2DShader: + return new Shaders.XnaBasic2D(); + + case AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader.Lighting2D: + case AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader.Lighting3D: + + default: + return null; + } + } + + protected internal override FrameBufferImpl CreateFrameBuffer(Size size) + { + throw new NotImplementedException(); + } + + protected internal override bool GetRenderState(RenderStateBool renderStateBool) + { + throw new NotImplementedException(); + } + + protected internal override void SetRenderState(RenderStateBool renderStateBool, bool value) + { + switch (renderStateBool) + { + case RenderStateBool.AlphaBlend: + mDevice.RenderState.AlphaBlendEnable = value; + break; + + default: + throw new NotSupportedException(); + } + } + + + + internal Microsoft.Xna.Framework.Graphics.Color Convert(Color color) + { + return new Microsoft.Xna.Framework.Graphics.Color(color.R, color.G, color.B, color.A); + } + + } +} + +#endif \ No newline at end of file Added: branches/xna/AgateLib/Xna/XnaDisplayFrameBuffer.cs =================================================================== --- branches/xna/AgateLib/Xna/XnaDisplayFrameBuffer.cs (rev 0) +++ branches/xna/AgateLib/Xna/XnaDisplayFrameBuffer.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,42 @@ + +#if XNA + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.DisplayLib.ImplementationBase; +using AgateLib.Geometry; + +namespace AgateLib.Xna +{ + class XnaDisplayFrameBuffer : FrameBufferImpl + { + Microsoft.Xna.Framework.Graphics.GraphicsDevice mDevice; + + public XnaDisplayFrameBuffer(Microsoft.Xna.Framework.Graphics.GraphicsDevice device) + { + mDevice = device; + } + + public override void Dispose() + { + } + + public override AgateLib.Geometry.Size Size + { + get { return new Size(mDevice.PresentationParameters.BackBufferWidth, mDevice.PresentationParameters.BackBufferHeight); } + } + + public override void BeginRender() + { + } + + public override void EndRender() + { + mDevice.Present(); + } + } +} + +#endif \ No newline at end of file Added: branches/xna/AgateLib/Xna/XnaDisplayWindow.cs =================================================================== --- branches/xna/AgateLib/Xna/XnaDisplayWindow.cs (rev 0) +++ branches/xna/AgateLib/Xna/XnaDisplayWindow.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,133 @@ + +#if XNA + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.DisplayLib; +using AgateLib.DisplayLib.ImplementationBase; +using Microsoft.Xna.Framework.Graphics; + +namespace AgateLib.Xna +{ + class XnaDisplayWindow : DisplayWindowImpl + { + XnaDisplay mDisplay; + GraphicsDevice mDevice; + XnaDisplayFrameBuffer mFrameBuffer; + + public XnaDisplayWindow(XnaDisplay disp, GraphicsDevice device) + { + mDisplay = disp; + mDevice = device; + + mFrameBuffer = new XnaDisplayFrameBuffer(mDevice); + } + +#if !XBOX360 + System.Windows.Forms.Form mForm; + + public XnaDisplayWindow(XnaDisplay disp, GraphicsDevice device, System.Windows.Forms.Form form) : this(disp, device) + { + mForm = form; + + mForm.Show(); + } + + public override void Dispose() + { + mForm.Dispose(); + } + public override string Title + { + get + { + return mForm.Text; + } + set + { + mForm.Text = value; + } + } + public override bool IsClosed + { + get + { + return mForm.IsDisposed; + } + } +#endif + +#if XBOX360 + public override void Dispose() + { + } + + public override bool IsClosed + { + get { return false; } + } + + public override string Title + { + get + { + return "AgateLib XNA Game"; + } + set + { + } + } +#endif + + + + public override bool IsFullScreen + { + get { return mDevice.PresentationParameters.IsFullScreen; } + } + + public override FrameBufferImpl FrameBuffer + { + get { return mFrameBuffer; } + } + + public override void SetWindowed() + { + } + public override void SetFullScreen() + { + } + public override void SetFullScreen(int width, int height, int bpp) + { + } + + public override AgateLib.Geometry.Size Size + { + get + { + return mFrameBuffer.Size; + } + set + { + throw new NotSupportedException(); + } + } + + public override AgateLib.Geometry.Point MousePosition + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + } +} + +#endif Modified: branches/xna/AgateXbox.sln =================================================================== --- branches/xna/AgateXbox.sln 2010-02-04 22:48:10 UTC (rev 1232) +++ branches/xna/AgateXbox.sln 2010-02-12 03:40:11 UTC (rev 1233) @@ -1,10 +1,14 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateXbox", "AgateLib\AgateLibXbox.csproj", "{F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLibXbox", "AgateLib\AgateLibXbox.csproj", "{F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLibXna", "AgateLib\AgateLibXna.csproj", "{AFD7F131-9954-41C2-852E-0BB68F44E80F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestXna", "TestXna\TestXna.csproj", "{A6FB6264-5E66-40BC-BD13-A3927D76F5D2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestXnaXbox", "TestXna\TestXnaXbox.csproj", "{3B4E7C92-0AB0-483F-A005-D4C04A7534BB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Mixed Platforms = Debug|Mixed Platforms @@ -25,12 +29,6 @@ {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|x86.ActiveCfg = Release|Xbox 360 {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|Xbox 360.Build.0 = Release|Xbox 360 - {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 - {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|x86.ActiveCfg = Debug|Xbox 360 - {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 - {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 - {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|x86.ActiveCfg = Release|Xbox 360 - {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|Mixed Platforms.Build.0 = Debug|x86 {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|x86.ActiveCfg = Debug|x86 @@ -41,12 +39,42 @@ {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|x86.ActiveCfg = Release|x86 {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|x86.Build.0 = Release|x86 {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|Xbox 360.ActiveCfg = Release|x86 - {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Debug|x86.ActiveCfg = Debug|x86 - {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Debug|Xbox 360.ActiveCfg = Debug|x86 - {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Release|x86.ActiveCfg = Release|x86 - {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Release|Xbox 360.ActiveCfg = Release|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Debug|x86.ActiveCfg = Debug|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Debug|x86.Build.0 = Debug|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Release|Mixed Platforms.Build.0 = Release|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Release|x86.ActiveCfg = Release|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Release|x86.Build.0 = Release|x86 + {A6FB6264-5E66-40BC-BD13-A3927D76F5D2}.Release|Xbox 360.ActiveCfg = Release|x86 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Debug|Mixed Platforms.Deploy.0 = Debug|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Debug|x86.ActiveCfg = Debug|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Debug|Xbox 360.Deploy.0 = Debug|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Release|Mixed Platforms.Deploy.0 = Release|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Release|x86.ActiveCfg = Release|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Release|Xbox 360.Build.0 = Release|Xbox 360 + {3B4E7C92-0AB0-483F-A005-D4C04A7534BB}.Release|Xbox 360.Deploy.0 = Release|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|x86.ActiveCfg = Debug|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|x86.ActiveCfg = Release|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 + {85C51EB3-84B1-4CD7-9221-8254B873AC2D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {85C51EB3-84B1-4CD7-9221-8254B873AC2D}.Debug|x86.ActiveCfg = Debug|x86 + {85C51EB3-84B1-4CD7-9221-8254B873AC2D}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {85C51EB3-84B1-4CD7-9221-8254B873AC2D}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {85C51EB3-84B1-4CD7-9221-8254B873AC2D}.Release|x86.ActiveCfg = Release|x86 + {85C51EB3-84B1-4CD7-9221-8254B873AC2D}.Release|Xbox 360.ActiveCfg = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Property changes on: branches/xna/TestXna ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Added: branches/xna/TestXna/Game.ico =================================================================== (Binary files differ) Property changes on: branches/xna/TestXna/Game.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/xna/TestXna/GameThumbnail.png =================================================================== (Binary files differ) Property changes on: branches/xna/TestXna/GameThumbnail.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/xna/TestXna/Program.cs =================================================================== --- branches/xna/TestXna/Program.cs (rev 0) +++ branches/xna/TestXna/Program.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,36 @@ +using System; +using AgateLib; +using AgateLib.DisplayLib; +using AgateLib.Geometry; + +namespace TestXna +{ + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + static void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup(args)) + { + setup.Initialize(true, false, false); + if (setup.WasCanceled) + return; + + var wind = DisplayWindow.CreateWindowed("Hello", 800, 600); + + while (wind.IsClosed == false) + { + Display.BeginFrame(); + Display.Clear(Color.Red); + + Display.EndFrame(); + Core.KeepAlive(); + + } + } + } + } +} + Added: branches/xna/TestXna/Properties/AssemblyInfo.cs =================================================================== --- branches/xna/TestXna/Properties/AssemblyInfo.cs (rev 0) +++ branches/xna/TestXna/Properties/AssemblyInfo.cs 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TestXna")] +[assembly: AssemblyProduct("TestXna")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("Microsoft")] + +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b116258c-5f4a-413f-8200-69df493f0d49")] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] Added: branches/xna/TestXna/TestXna.csproj =================================================================== --- branches/xna/TestXna/TestXna.csproj (rev 0) +++ branches/xna/TestXna/TestXna.csproj 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,141 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <ProjectGuid>{A6FB6264-5E66-40BC-BD13-A3927D76F5D2}</ProjectGuid> + <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>TestXna</RootNamespace> + <AssemblyName>TestXna</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <XnaFrameworkVersion>v3.1</XnaFrameworkVersion> + <XnaPlatform>Windows</XnaPlatform> + <XnaCrossPlatformGroupID>cc3da6dc-db01-4983-a4f3-1f714ee0a560</XnaCrossPlatformGroupID> + <ApplicationIcon>Game.ico</ApplicationIcon> + <Thumbnail>GameThumbnail.png</Thumbnail> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\x86\Debug</OutputPath> + <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <PlatformTarget>x86</PlatformTarget> + <XnaCompressContent>false</XnaCompressContent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\x86\Release</OutputPath> + <DefineConstants>TRACE;WINDOWS</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <PlatformTarget>x86</PlatformTarget> + <XnaCompressContent>true</XnaCompressContent> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d, processorArchitecture=x86"> + <Private>False</Private> + <SpecificVersion>True</SpecificVersion> + </Reference> + <Reference Include="Microsoft.Xna.Framework.Game, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d, processorArchitecture=MSIL"> + <Private>False</Private> + <SpecificVersion>True</SpecificVersion> + </Reference> + <Reference Include="mscorlib"> + <Private>False</Private> + </Reference> + <Reference Include="System"> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml"> + <Private>False</Private> + </Reference> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Program.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="Game.ico" /> + <Content Include="GameThumbnail.png" /> + </ItemGroup> + <ItemGroup> + <NestedContentProject Include="Content\Content.contentproj"> + <Project>85c51eb3-84b1-4cd7-9221-8254b873ac2d</Project> + <Visible>False</Visible> + </NestedContentProject> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\AgateLib\AgateLibXna.csproj"> + <Project>{AFD7F131-9954-41C2-852E-0BB68F44E80F}</Project> + <Name>AgateLibXna</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> + <Visible>False</Visible> + <ProductName>.NET Framework 2.0 %28x86%29</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.0 %28x86%29</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> + <Visible>False</Visible> + <ProductName>Windows Installer 3.1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Xna.Framework.3.1"> + <Visible>False</Visible> + <ProductName>Microsoft XNA Framework Redistributable 3.1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: branches/xna/TestXna/TestXnaXbox.csproj =================================================================== --- branches/xna/TestXna/TestXnaXbox.csproj (rev 0) +++ branches/xna/TestXna/TestXnaXbox.csproj 2010-02-12 03:40:11 UTC (rev 1233) @@ -0,0 +1,88 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <ProjectGuid>{3B4E7C92-0AB0-483F-A005-D4C04A7534BB}</ProjectGuid> + <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">Xbox 360</Platform> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>TestXnaXbox</RootNamespace> + <AssemblyName>TestXnaXbox</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <XnaFrameworkVersion>v3.1</XnaFrameworkVersion> + <XnaPlatform>Xbox 360</XnaPlatform> + <XnaCrossPlatformGroupID>7f7cea2a-d8c0-4e94-bfd9-78a7a0ee0499</XnaCrossPlatformGroupID> + <Thumbnail>GameThumbnail.png</Thumbnail> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Xbox 360' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Xbox 360\Debug</OutputPath> + <DefineConstants>DEBUG;TRACE;XBOX;XBOX360</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <XnaCompressContent>true</XnaCompressContent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Xbox 360' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Xbox 360\Release</OutputPath> + <DefineConstants>TRACE;XBOX;XBOX360</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <XnaCompressContent>true</XnaCompressContent> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Xna.Framework"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.Xna.Framework.Game"> + <Private>False</Private> + </Reference> + <Reference Include="mscorlib"> + <Private>False</Private> + </Reference> + <Reference Include="System"> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml"> + <Private>False</Private> + </Reference> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Program.cs" /> + <Compile Include="Game1.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="GameThumbnail.png" /> + </ItemGroup> + <ItemGroup> + <NestedContentProject Include="Content\Content.contentproj"> + <Project>e456817c-f835-4444-960a-d1adb40da44f</Project> + <Visible>False</Visible> + </NestedContentProject> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file This was sent by the SourceForge.net c... [truncated message content] |
From: <ka...@us...> - 2010-02-04 22:48:23
|
Revision: 1232 http://agate.svn.sourceforge.net/agate/?rev=1232&view=rev Author: kanato Date: 2010-02-04 22:48:10 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Add Xna windows project and missing solution file. Added Paths: ----------- branches/xna/AgateLib/AgateLibXbox.csproj branches/xna/AgateLib/AgateLibXna.csproj branches/xna/AgateXbox.sln Removed Paths: ------------- branches/xna/AgateLib/AgateXbox.csproj branches/xna/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs Added: branches/xna/AgateLib/AgateLibXbox.csproj =================================================================== --- branches/xna/AgateLib/AgateLibXbox.csproj (rev 0) +++ branches/xna/AgateLib/AgateLibXbox.csproj 2010-02-04 22:48:10 UTC (rev 1232) @@ -0,0 +1,312 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <ProjectGuid>{F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}</ProjectGuid> + <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">Xbox 360</Platform> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>AgateLib</RootNamespace> + <AssemblyName>AgateLib</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <XnaFrameworkVersion>v3.1</XnaFrameworkVersion> + <XnaPlatform>Xbox 360</XnaPlatform> + <XnaCrossPlatformGroupID>bd8ab9e4-0d4e-43cb-be34-8a03144b40eb</XnaCrossPlatformGroupID> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Xbox 360' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Xbox 360\Debug</OutputPath> + <DefineConstants>DEBUG;TRACE;XBOX;XBOX360</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <XnaCompressContent>true</XnaCompressContent> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Xbox 360' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Xbox 360\Release</OutputPath> + <DefineConstants>TRACE;XBOX;XBOX360</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <XnaCompressContent>true</XnaCompressContent> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Xna.Framework"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.Xna.Framework.Game"> + <Private>False</Private> + </Reference> + <Reference Include="mscorlib"> + <Private>False</Private> + </Reference> + <Reference Include="System"> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml"> + <Private>False</Private> + </Reference> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AgateException.cs" /> + <Compile Include="AgateFileProvider.cs" /> + <Compile Include="AgateGame.cs" /> + <Compile Include="AgateSetup.cs" /> + <Compile Include="AppInitParameters.cs" /> + <Compile Include="AudioLib\Audio.cs" /> + <Compile Include="AudioLib\AudioCapsInfo.cs" /> + <Compile Include="AudioLib\ImplementationBase\AudioImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\MusicImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\SoundBufferImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\SoundBufferSessionImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\StreamingSoundBufferImpl.cs" /> + <Compile Include="AudioLib\Music.cs" /> + <Compile Include="AudioLib\SoundBuffer.cs" /> + <Compile Include="AudioLib\SoundBufferSession.cs" /> + <Compile Include="AudioLib\SoundFormat.cs" /> + <Compile Include="AudioLib\StreamingSoundBuffer.cs" /> + <Compile Include="BitmapFont\BitmapFontImpl.cs" /> + <Compile Include="BitmapFont\BitmapFontOptions.cs" /> + <Compile Include="BitmapFont\FontMetrics.cs" /> + <Compile Include="BitmapFont\GlyphMetrics.cs" /> + <Compile Include="CompatibilityExtensions\Enums.cs" /> + <Compile Include="Core.cs" /> + <Compile Include="Data\AgateColumn.cs" /> + <Compile Include="Data\AgateColumnDictionary.cs" /> + <Compile Include="Data\AgateDatabase.cs" /> + <Compile Include="Data\AgateDatabaseException.cs" /> + <Compile Include="Data\AgateDataHelper.cs" /> + <Compile Include="Data\AgateRow.cs" /> + <Compile Include="Data\AgateRowList.cs" /> + <Compile Include="Data\AgateTable.cs" /> + <Compile Include="Data\AgateTableDictionary.cs" /> + <Compile Include="Data\FieldType.cs" /> + <Compile Include="DisplayLib\Cache\FontStateCache.cs" /> + <Compile Include="DisplayLib\Cache\SurfaceStateCache.cs" /> + <Compile Include="DisplayLib\CreateWindowParams.cs" /> + <Compile Include="DisplayLib\Display.cs" /> + <Compile Include="DisplayLib\DisplayCapsInfo.cs" /> + <Compile Include="DisplayLib\DisplayWindow.cs" /> + <Compile Include="DisplayLib\FontState.cs" /> + <Compile Include="DisplayLib\FontSurface.cs" /> + <Compile Include="DisplayLib\FrameBuffer.cs" /> + <Compile Include="DisplayLib\ImplementationBase\DisplayImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\DisplayWindowImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\FontSurfaceImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\FrameBufferImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\IndexBufferImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\ShaderCompilerImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\SurfaceImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\VertexBufferImpl.cs" /> + <Compile Include="DisplayLib\IndexBuffer.cs" /> + <Compile Include="DisplayLib\ISurface.cs" /> + <Compile Include="DisplayLib\Origin.cs" /> + <Compile Include="DisplayLib\OriginAlignment.cs" /> + <Compile Include="DisplayLib\PixelBuffer.cs" /> + <Compile Include="DisplayLib\PixelFormat.cs" /> + <Compile Include="DisplayLib\PrimitiveType.cs" /> + <Compile Include="DisplayLib\RenderStateAdapter.cs" /> + <Compile Include="DisplayLib\ScreenMode.cs" /> + <Compile Include="DisplayLib\Shaders\AgateBuiltInShaders.cs" /> + <Compile Include="DisplayLib\Shaders\AgateShader.cs" /> + <Compile Include="DisplayLib\Shaders\AgateShaderCompileError.cs" /> + <Compile Include="DisplayLib\Shaders\Basic2DShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Basic2DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Effect.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderCompiler.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderLanguage.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderProgram.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Technique.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\UniformState.cs" /> + <Compile Include="DisplayLib\Shaders\Lighting2D.cs" /> + <Compile Include="DisplayLib\Shaders\Lighting3D.cs" /> + <Compile Include="DisplayLib\StringTransformer.cs" /> + <Compile Include="DisplayLib\Surface.cs" /> + <Compile Include="DisplayLib\SurfaceState.cs" /> + <Compile Include="DisplayLib\TextLayout.cs" /> + <Compile Include="DisplayLib\VertexBuffer.cs" /> + <Compile Include="Drivers\AgateDriverInfo.cs" /> + <Compile Include="Drivers\AgateDriverReporter.cs" /> + <Compile Include="Drivers\AgateSandBoxLoader.cs" /> + <Compile Include="Drivers\DriverImplBase.cs" /> + <Compile Include="Drivers\IDesktopDriver.cs" /> + <Compile Include="Drivers\IUserSetSystems.cs" /> + <Compile Include="Drivers\NullInputImpl.cs" /> + <Compile Include="Drivers\NullSoundImpl.cs" /> + <Compile Include="Drivers\Registrar.cs" /> + <Compile Include="Drivers\TypeID.cs" /> + <Compile Include="CompatibilityExtensions\Numerics.cs" /> + <Compile Include="CompatibilityExtensions\FakeAttributes.cs" /> + <Compile Include="Geometry\Builders\Cube.cs" /> + <Compile Include="Geometry\Builders\Terrain.cs" /> + <Compile Include="Geometry\Color.cs" /> + <Compile Include="Geometry\Gradient.cs" /> + <Compile Include="Geometry\Matrix4x4.cs" /> + <Compile Include="Geometry\Point.cs" /> + <Compile Include="Geometry\PointF.cs" /> + <Compile Include="Geometry\Rectangle.cs" /> + <Compile Include="Geometry\RectangleF.cs" /> + <Compile Include="Geometry\Size.cs" /> + <Compile Include="Geometry\SizeF.cs" /> + <Compile Include="Geometry\TypeConverters.cs" /> + <Compile Include="Geometry\Vector2.cs" /> + <Compile Include="Geometry\Vector3.cs" /> + <Compile Include="Geometry\Vector4.cs" /> + <Compile Include="Geometry\VertexTypes\PositionColor.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureColor.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNormal.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNormalTangent.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNTB.cs" /> + <Compile Include="Geometry\VertexTypes\VertexLayout.cs" /> + <Compile Include="Gui\AgateGuiException.cs" /> + <Compile Include="Gui\Button.cs" /> + <Compile Include="Gui\Cache\WidgetCache.cs" /> + <Compile Include="Gui\CheckBox.cs" /> + <Compile Include="Gui\ComboBox.cs" /> + <Compile Include="Gui\Container.cs" /> + <Compile Include="Gui\GuiRoot.cs" /> + <Compile Include="Gui\IGuiThemeEngine.cs" /> + <Compile Include="Gui\ILayoutPerformer.cs" /> + <Compile Include="Gui\Label.cs" /> + <Compile Include="Gui\LayoutExpand.cs" /> + <Compile Include="Gui\Layout\BoxLayoutBase.cs" /> + <Compile Include="Gui\Layout\Grid.cs" /> + <Compile Include="Gui\Layout\HorizontalBox.cs" /> + <Compile Include="Gui\Layout\VerticalBox.cs" /> + <Compile Include="Gui\ListBox.cs" /> + <Compile Include="Gui\Panel.cs" /> + <Compile Include="Gui\RadioButton.cs" /> + <Compile Include="Gui\ScrollBar.cs" /> + <Compile Include="Gui\TextBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Cache\ScrollBarCache.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Cache\TextBoxCache.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Mercury.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryButton.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryCheckBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryGuiRoot.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryLabel.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryListBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryPanel.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryScheme.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryScrollBar.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryTextBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryWidget.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryWindow.cs" /> + <Compile Include="Gui\Widget.cs" /> + <Compile Include="Gui\WidgetList.cs" /> + <Compile Include="Gui\Window.cs" /> + <Compile Include="IFileProvider.cs" /> + <Compile Include="InputLib\ImplementationBase\InputImpl.cs" /> + <Compile Include="InputLib\ImplementationBase\JoystickImpl.cs" /> + <Compile Include="InputLib\InputEventArgs.cs" /> + <Compile Include="InputLib\Joystick.cs" /> + <Compile Include="InputLib\JoystickInput.cs" /> + <Compile Include="InputLib\Keyboard.cs" /> + <Compile Include="InputLib\KeyCode.cs" /> + <Compile Include="InputLib\KeyModifiers.cs" /> + <Compile Include="InputLib\Mouse.cs" /> + <Compile Include="InternalResources\Data.cs" /> + <Compile Include="InternalResources\DataResources.Designer.cs" /> + <Compile Include="IPlatform.cs" /> + <Compile Include="Meshes\Loaders\OBJFileRepresentation.cs" /> + <Compile Include="Meshes\Loaders\Obj\OBJFileRepresentation.cs" /> + <Compile Include="Meshes\Loaders\Obj\Parser.cs" /> + <Compile Include="Meshes\Loaders\Obj\TokenTypes.cs" /> + <Compile Include="Particles\Emitters\PixelEmitter.cs" /> + <Compile Include="Particles\Emitters\SpriteEmitter.cs" /> + <Compile Include="Particles\Emitters\SurfaceEmitter.cs" /> + <Compile Include="Particles\Manipulators\FadeOutManipulator.cs" /> + <Compile Include="Particles\Manipulators\GravityManipulator.cs" /> + <Compile Include="Particles\Manipulators\GravityPointManipulator.cs" /> + <Compile Include="Particles\Particle.cs" /> + <Compile Include="Particles\ParticleEmitter.cs" /> + <Compile Include="Particles\Particles\PixelParticle.cs" /> + <Compile Include="Particles\Particles\SpriteParticle.cs" /> + <Compile Include="Particles\Particles\SurfaceParticle.cs" /> + <Compile Include="PlatformType.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Resources\AgateResource.cs" /> + <Compile Include="Resources\AgateResourceCollection.cs" /> + <Compile Include="Resources\AgateResourceException.cs" /> + <Compile Include="Resources\AgateResourceLoader.cs" /> + <Compile Include="Resources\BitmapFontResource.cs" /> + <Compile Include="Resources\DisplayWindowResource.cs" /> + <Compile Include="Resources\SpriteResource.cs" /> + <Compile Include="Resources\StringTable.cs" /> + <Compile Include="Resources\SurfaceResource.cs" /> + <Compile Include="Resources\XmlHelper.cs" /> + <Compile Include="Serialization\Formatters\Xml\XmlFormatter.cs" /> + <Compile Include="Serialization\Xle\CompressionType.cs" /> + <Compile Include="Serialization\Xle\ITypeBinder.cs" /> + <Compile Include="Serialization\Xle\IXleSerializable.cs" /> + <Compile Include="Serialization\Xle\TypeBinder.cs" /> + <Compile Include="Serialization\Xle\XleSerializationException.cs" /> + <Compile Include="Serialization\Xle\XleSerializationInfo.cs" /> + <Compile Include="Serialization\Xle\XleSerializer.cs" /> + <Compile Include="Settings\PersistantSettings.cs" /> + <Compile Include="Settings\SettingsGroup.cs" /> + <Compile Include="Sprites\FrameList.cs" /> + <Compile Include="Sprites\IFrameList.cs" /> + <Compile Include="Sprites\ISprite.cs" /> + <Compile Include="Sprites\ISpriteFrame.cs" /> + <Compile Include="Sprites\Sprite.cs" /> + <Compile Include="Sprites\SpriteFrame.cs" /> + <Compile Include="Timing.cs" /> + <Compile Include="Utility\FileProviderList.cs" /> + <Compile Include="Utility\FileSystemProvider.cs" /> + <Compile Include="Utility\Platform.cs" /> + <Compile Include="Utility\Ref.cs" /> + <Compile Include="Utility\SurfacePacker.cs" /> + <Compile Include="Utility\TgzFileProvider.cs" /> + <Compile Include="Utility\ZipFileProvider.cs" /> + <Compile Include="CompatibilityExtensions\XboxExtensions.cs" /> + </ItemGroup> + <ItemGroup> + <NestedContentProject Include="Content\Content.contentproj"> + <Project>cb57c4be-41f0-4674-a282-fd960f64b793</Project> + <Visible>False</Visible> + </NestedContentProject> + </ItemGroup> + <ItemGroup> + <Content Include="Drivers\improve_registrar.txt" /> + </ItemGroup> + <ItemGroup> + <None Include="InternalResources\agate-black-gui.zip" /> + <None Include="InternalResources\Fonts.zip" /> + <None Include="InternalResources\images.tar.gz" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="InternalResources\DataResources.resx" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: branches/xna/AgateLib/AgateLibXna.csproj =================================================================== --- branches/xna/AgateLib/AgateLibXna.csproj (rev 0) +++ branches/xna/AgateLib/AgateLibXna.csproj 2010-02-04 22:48:10 UTC (rev 1232) @@ -0,0 +1,355 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <ProjectGuid>{AFD7F131-9954-41C2-852E-0BB68F44E80F}</ProjectGuid> + <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>AgateLibXna</RootNamespace> + <AssemblyName>AgateLibXna</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <XnaFrameworkVersion>v3.1</XnaFrameworkVersion> + <XnaPlatform>Windows</XnaPlatform> + <XnaCrossPlatformGroupID>8a5c3419-3b27-4e15-be28-b21f48cc86e4</XnaCrossPlatformGroupID> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\x86\Debug</OutputPath> + <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <PlatformTarget>x86</PlatformTarget> + <XnaCompressContent>false</XnaCompressContent> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\x86\Release</OutputPath> + <DefineConstants>TRACE;WINDOWS</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <PlatformTarget>x86</PlatformTarget> + <XnaCompressContent>true</XnaCompressContent> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d, processorArchitecture=x86"> + <Private>False</Private> + <SpecificVersion>True</SpecificVersion> + </Reference> + <Reference Include="Microsoft.Xna.Framework.Game, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d, processorArchitecture=MSIL"> + <Private>False</Private> + <SpecificVersion>True</SpecificVersion> + </Reference> + <Reference Include="mscorlib"> + <Private>False</Private> + </Reference> + <Reference Include="System"> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml"> + <Private>False</Private> + </Reference> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AgateException.cs" /> + <Compile Include="AgateFileProvider.cs" /> + <Compile Include="AgateGame.cs" /> + <Compile Include="AgateSetup.cs" /> + <Compile Include="AppInitParameters.cs" /> + <Compile Include="AudioLib\Audio.cs" /> + <Compile Include="AudioLib\AudioCapsInfo.cs" /> + <Compile Include="AudioLib\ImplementationBase\AudioImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\MusicImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\SoundBufferImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\SoundBufferSessionImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\StreamingSoundBufferImpl.cs" /> + <Compile Include="AudioLib\Music.cs" /> + <Compile Include="AudioLib\SoundBuffer.cs" /> + <Compile Include="AudioLib\SoundBufferSession.cs" /> + <Compile Include="AudioLib\SoundFormat.cs" /> + <Compile Include="AudioLib\StreamingSoundBuffer.cs" /> + <Compile Include="BitmapFont\BitmapFontImpl.cs" /> + <Compile Include="BitmapFont\BitmapFontOptions.cs" /> + <Compile Include="BitmapFont\FontMetrics.cs" /> + <Compile Include="BitmapFont\GlyphMetrics.cs" /> + <Compile Include="CompatibilityExtensions\Enums.cs" /> + <Compile Include="CompatibilityExtensions\FakeAttributes.cs" /> + <Compile Include="CompatibilityExtensions\Numerics.cs" /> + <Compile Include="CompatibilityExtensions\XboxExtensions.cs" /> + <Compile Include="Core.cs" /> + <Compile Include="Data\AgateColumn.cs" /> + <Compile Include="Data\AgateColumnDictionary.cs" /> + <Compile Include="Data\AgateDatabase.cs" /> + <Compile Include="Data\AgateDatabaseException.cs" /> + <Compile Include="Data\AgateDataHelper.cs" /> + <Compile Include="Data\AgateRow.cs" /> + <Compile Include="Data\AgateRowList.cs" /> + <Compile Include="Data\AgateTable.cs" /> + <Compile Include="Data\AgateTableDictionary.cs" /> + <Compile Include="Data\FieldType.cs" /> + <Compile Include="DisplayLib\Cache\FontStateCache.cs" /> + <Compile Include="DisplayLib\Cache\SurfaceStateCache.cs" /> + <Compile Include="DisplayLib\CreateWindowParams.cs" /> + <Compile Include="DisplayLib\Display.cs" /> + <Compile Include="DisplayLib\DisplayCapsInfo.cs" /> + <Compile Include="DisplayLib\DisplayWindow.cs" /> + <Compile Include="DisplayLib\FontState.cs" /> + <Compile Include="DisplayLib\FontSurface.cs" /> + <Compile Include="DisplayLib\FrameBuffer.cs" /> + <Compile Include="DisplayLib\ImplementationBase\DisplayImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\DisplayWindowImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\FontSurfaceImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\FrameBufferImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\IndexBufferImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\ShaderCompilerImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\SurfaceImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\VertexBufferImpl.cs" /> + <Compile Include="DisplayLib\IndexBuffer.cs" /> + <Compile Include="DisplayLib\ISurface.cs" /> + <Compile Include="DisplayLib\Origin.cs" /> + <Compile Include="DisplayLib\OriginAlignment.cs" /> + <Compile Include="DisplayLib\PixelBuffer.cs" /> + <Compile Include="DisplayLib\PixelFormat.cs" /> + <Compile Include="DisplayLib\PrimitiveType.cs" /> + <Compile Include="DisplayLib\RenderStateAdapter.cs" /> + <Compile Include="DisplayLib\ScreenMode.cs" /> + <Compile Include="DisplayLib\Shaders\AgateBuiltInShaders.cs" /> + <Compile Include="DisplayLib\Shaders\AgateShader.cs" /> + <Compile Include="DisplayLib\Shaders\AgateShaderCompileError.cs" /> + <Compile Include="DisplayLib\Shaders\Basic2DShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Basic2DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Effect.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderCompiler.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderLanguage.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderProgram.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Technique.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\UniformState.cs" /> + <Compile Include="DisplayLib\Shaders\Lighting2D.cs" /> + <Compile Include="DisplayLib\Shaders\Lighting3D.cs" /> + <Compile Include="DisplayLib\StringTransformer.cs" /> + <Compile Include="DisplayLib\Surface.cs" /> + <Compile Include="DisplayLib\SurfaceState.cs" /> + <Compile Include="DisplayLib\TextLayout.cs" /> + <Compile Include="DisplayLib\VertexBuffer.cs" /> + <Compile Include="Drivers\AgateDriverInfo.cs" /> + <Compile Include="Drivers\AgateDriverReporter.cs" /> + <Compile Include="Drivers\AgateSandBoxLoader.cs" /> + <Compile Include="Drivers\DriverImplBase.cs" /> + <Compile Include="Drivers\IDesktopDriver.cs" /> + <Compile Include="Drivers\IUserSetSystems.cs" /> + <Compile Include="Drivers\NullInputImpl.cs" /> + <Compile Include="Drivers\NullSoundImpl.cs" /> + <Compile Include="Drivers\Registrar.cs" /> + <Compile Include="Drivers\TypeID.cs" /> + <Compile Include="Geometry\Builders\Cube.cs" /> + <Compile Include="Geometry\Builders\Terrain.cs" /> + <Compile Include="Geometry\Color.cs" /> + <Compile Include="Geometry\Gradient.cs" /> + <Compile Include="Geometry\Matrix4x4.cs" /> + <Compile Include="Geometry\Point.cs" /> + <Compile Include="Geometry\PointF.cs" /> + <Compile Include="Geometry\Rectangle.cs" /> + <Compile Include="Geometry\RectangleF.cs" /> + <Compile Include="Geometry\Size.cs" /> + <Compile Include="Geometry\SizeF.cs" /> + <Compile Include="Geometry\TypeConverters.cs" /> + <Compile Include="Geometry\Vector2.cs" /> + <Compile Include="Geometry\Vector3.cs" /> + <Compile Include="Geometry\Vector4.cs" /> + <Compile Include="Geometry\VertexTypes\PositionColor.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureColor.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNormal.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNormalTangent.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNTB.cs" /> + <Compile Include="Geometry\VertexTypes\VertexLayout.cs" /> + <Compile Include="Gui\AgateGuiException.cs" /> + <Compile Include="Gui\Button.cs" /> + <Compile Include="Gui\Cache\WidgetCache.cs" /> + <Compile Include="Gui\CheckBox.cs" /> + <Compile Include="Gui\ComboBox.cs" /> + <Compile Include="Gui\Container.cs" /> + <Compile Include="Gui\GuiRoot.cs" /> + <Compile Include="Gui\IGuiThemeEngine.cs" /> + <Compile Include="Gui\ILayoutPerformer.cs" /> + <Compile Include="Gui\Label.cs" /> + <Compile Include="Gui\LayoutExpand.cs" /> + <Compile Include="Gui\Layout\BoxLayoutBase.cs" /> + <Compile Include="Gui\Layout\Grid.cs" /> + <Compile Include="Gui\Layout\HorizontalBox.cs" /> + <Compile Include="Gui\Layout\VerticalBox.cs" /> + <Compile Include="Gui\ListBox.cs" /> + <Compile Include="Gui\Panel.cs" /> + <Compile Include="Gui\RadioButton.cs" /> + <Compile Include="Gui\ScrollBar.cs" /> + <Compile Include="Gui\TextBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Cache\ScrollBarCache.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Cache\TextBoxCache.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Mercury.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryButton.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryCheckBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryGuiRoot.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryLabel.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryListBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryPanel.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryScheme.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryScrollBar.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryTextBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryWidget.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryWindow.cs" /> + <Compile Include="Gui\Widget.cs" /> + <Compile Include="Gui\WidgetList.cs" /> + <Compile Include="Gui\Window.cs" /> + <Compile Include="IFileProvider.cs" /> + <Compile Include="InputLib\ImplementationBase\InputImpl.cs" /> + <Compile Include="InputLib\ImplementationBase\JoystickImpl.cs" /> + <Compile Include="InputLib\InputEventArgs.cs" /> + <Compile Include="InputLib\Joystick.cs" /> + <Compile Include="InputLib\JoystickInput.cs" /> + <Compile Include="InputLib\Keyboard.cs" /> + <Compile Include="InputLib\KeyCode.cs" /> + <Compile Include="InputLib\KeyModifiers.cs" /> + <Compile Include="InputLib\Mouse.cs" /> + <Compile Include="InternalResources\Data.cs" /> + <Compile Include="InternalResources\DataResources.Designer.cs" /> + <Compile Include="IPlatform.cs" /> + <Compile Include="Meshes\Loaders\OBJFileRepresentation.cs" /> + <Compile Include="Meshes\Loaders\Obj\OBJFileRepresentation.cs" /> + <Compile Include="Meshes\Loaders\Obj\Parser.cs" /> + <Compile Include="Meshes\Loaders\Obj\TokenTypes.cs" /> + <Compile Include="Particles\Emitters\PixelEmitter.cs" /> + <Compile Include="Particles\Emitters\SpriteEmitter.cs" /> + <Compile Include="Particles\Emitters\SurfaceEmitter.cs" /> + <Compile Include="Particles\Manipulators\FadeOutManipulator.cs" /> + <Compile Include="Particles\Manipulators\GravityManipulator.cs" /> + <Compile Include="Particles\Manipulators\GravityPointManipulator.cs" /> + <Compile Include="Particles\Particle.cs" /> + <Compile Include="Particles\ParticleEmitter.cs" /> + <Compile Include="Particles\Particles\PixelParticle.cs" /> + <Compile Include="Particles\Particles\SpriteParticle.cs" /> + <Compile Include="Particles\Particles\SurfaceParticle.cs" /> + <Compile Include="PlatformType.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Resources\AgateResource.cs" /> + <Compile Include="Resources\AgateResourceCollection.cs" /> + <Compile Include="Resources\AgateResourceException.cs" /> + <Compile Include="Resources\AgateResourceLoader.cs" /> + <Compile Include="Resources\BitmapFontResource.cs" /> + <Compile Include="Resources\DisplayWindowResource.cs" /> + <Compile Include="Resources\SpriteResource.cs" /> + <Compile Include="Resources\StringTable.cs" /> + <Compile Include="Resources\SurfaceResource.cs" /> + <Compile Include="Resources\XmlHelper.cs" /> + <Compile Include="Serialization\Formatters\Xml\XmlFormatter.cs" /> + <Compile Include="Serialization\Xle\CompressionType.cs" /> + <Compile Include="Serialization\Xle\ITypeBinder.cs" /> + <Compile Include="Serialization\Xle\IXleSerializable.cs" /> + <Compile Include="Serialization\Xle\TypeBinder.cs" /> + <Compile Include="Serialization\Xle\XleSerializationException.cs" /> + <Compile Include="Serialization\Xle\XleSerializationInfo.cs" /> + <Compile Include="Serialization\Xle\XleSerializer.cs" /> + <Compile Include="Settings\PersistantSettings.cs" /> + <Compile Include="Settings\SettingsGroup.cs" /> + <Compile Include="Sprites\FrameList.cs" /> + <Compile Include="Sprites\IFrameList.cs" /> + <Compile Include="Sprites\ISprite.cs" /> + <Compile Include="Sprites\ISpriteFrame.cs" /> + <Compile Include="Sprites\Sprite.cs" /> + <Compile Include="Sprites\SpriteFrame.cs" /> + <Compile Include="Timing.cs" /> + <Compile Include="Utility\FileProviderList.cs" /> + <Compile Include="Utility\FileSystemProvider.cs" /> + <Compile Include="Utility\Platform.cs" /> + <Compile Include="Utility\Ref.cs" /> + <Compile Include="Utility\SurfacePacker.cs" /> + <Compile Include="Utility\TgzFileProvider.cs" /> + <Compile Include="Utility\ZipFileProvider.cs" /> + </ItemGroup> + <ItemGroup> + <NestedContentProject Include="Content\Content.contentproj"> + <Project>d562c72e-576e-4e8c-8dc1-85365a173edc</Project> + <Visible>False</Visible> + </NestedContentProject> + </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> + <Visible>False</Visible> + <ProductName>.NET Framework 2.0 %28x86%29</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.0 %28x86%29</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> + <Visible>False</Visible> + <ProductName>Windows Installer 3.1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Xna.Framework.3.1"> + <Visible>False</Visible> + <ProductName>Microsoft XNA Framework Redistributable 3.1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + </ItemGroup> + <ItemGroup> + <None Include="InternalResources\agate-black-gui.zip" /> + <None Include="InternalResources\Fonts.zip" /> + <None Include="InternalResources\images.tar.gz" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="InternalResources\DataResources.resx" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Deleted: branches/xna/AgateLib/AgateXbox.csproj =================================================================== --- branches/xna/AgateLib/AgateXbox.csproj 2010-02-04 20:39:40 UTC (rev 1231) +++ branches/xna/AgateLib/AgateXbox.csproj 2010-02-04 22:48:10 UTC (rev 1232) @@ -1,312 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> - <PropertyGroup> - <ProjectGuid>{F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}</ProjectGuid> - <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">Xbox 360</Platform> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>AgateLib</RootNamespace> - <AssemblyName>AgateLib</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> - <XnaFrameworkVersion>v3.1</XnaFrameworkVersion> - <XnaPlatform>Xbox 360</XnaPlatform> - <XnaCrossPlatformGroupID>bd8ab9e4-0d4e-43cb-be34-8a03144b40eb</XnaCrossPlatformGroupID> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Xbox 360' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Xbox 360\Debug</OutputPath> - <DefineConstants>DEBUG;TRACE;XBOX;XBOX360</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <NoStdLib>true</NoStdLib> - <UseVSHostingProcess>false</UseVSHostingProcess> - <XnaCompressContent>true</XnaCompressContent> - <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Xbox 360' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Xbox 360\Release</OutputPath> - <DefineConstants>TRACE;XBOX;XBOX360</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <NoStdLib>true</NoStdLib> - <UseVSHostingProcess>false</UseVSHostingProcess> - <XnaCompressContent>true</XnaCompressContent> - <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - </PropertyGroup> - <ItemGroup> - <Reference Include="Microsoft.Xna.Framework"> - <Private>False</Private> - </Reference> - <Reference Include="Microsoft.Xna.Framework.Game"> - <Private>False</Private> - </Reference> - <Reference Include="mscorlib"> - <Private>False</Private> - </Reference> - <Reference Include="System"> - <Private>False</Private> - </Reference> - <Reference Include="System.Xml"> - <Private>False</Private> - </Reference> - <Reference Include="System.Core"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - <Private>False</Private> - </Reference> - <Reference Include="System.Xml.Linq"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - <Private>False</Private> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="AgateException.cs" /> - <Compile Include="AgateFileProvider.cs" /> - <Compile Include="AgateGame.cs" /> - <Compile Include="AgateSetup.cs" /> - <Compile Include="AppInitParameters.cs" /> - <Compile Include="AudioLib\Audio.cs" /> - <Compile Include="AudioLib\AudioCapsInfo.cs" /> - <Compile Include="AudioLib\ImplementationBase\AudioImpl.cs" /> - <Compile Include="AudioLib\ImplementationBase\MusicImpl.cs" /> - <Compile Include="AudioLib\ImplementationBase\SoundBufferImpl.cs" /> - <Compile Include="AudioLib\ImplementationBase\SoundBufferSessionImpl.cs" /> - <Compile Include="AudioLib\ImplementationBase\StreamingSoundBufferImpl.cs" /> - <Compile Include="AudioLib\Music.cs" /> - <Compile Include="AudioLib\SoundBuffer.cs" /> - <Compile Include="AudioLib\SoundBufferSession.cs" /> - <Compile Include="AudioLib\SoundFormat.cs" /> - <Compile Include="AudioLib\StreamingSoundBuffer.cs" /> - <Compile Include="BitmapFont\BitmapFontImpl.cs" /> - <Compile Include="BitmapFont\BitmapFontOptions.cs" /> - <Compile Include="BitmapFont\FontMetrics.cs" /> - <Compile Include="BitmapFont\GlyphMetrics.cs" /> - <Compile Include="CompatibilityExtensions\Enums.cs" /> - <Compile Include="Core.cs" /> - <Compile Include="Data\AgateColumn.cs" /> - <Compile Include="Data\AgateColumnDictionary.cs" /> - <Compile Include="Data\AgateDatabase.cs" /> - <Compile Include="Data\AgateDatabaseException.cs" /> - <Compile Include="Data\AgateDataHelper.cs" /> - <Compile Include="Data\AgateRow.cs" /> - <Compile Include="Data\AgateRowList.cs" /> - <Compile Include="Data\AgateTable.cs" /> - <Compile Include="Data\AgateTableDictionary.cs" /> - <Compile Include="Data\FieldType.cs" /> - <Compile Include="DisplayLib\Cache\FontStateCache.cs" /> - <Compile Include="DisplayLib\Cache\SurfaceStateCache.cs" /> - <Compile Include="DisplayLib\CreateWindowParams.cs" /> - <Compile Include="DisplayLib\Display.cs" /> - <Compile Include="DisplayLib\DisplayCapsInfo.cs" /> - <Compile Include="DisplayLib\DisplayWindow.cs" /> - <Compile Include="DisplayLib\FontState.cs" /> - <Compile Include="DisplayLib\FontSurface.cs" /> - <Compile Include="DisplayLib\FrameBuffer.cs" /> - <Compile Include="DisplayLib\ImplementationBase\DisplayImpl.cs" /> - <Compile Include="DisplayLib\ImplementationBase\DisplayWindowImpl.cs" /> - <Compile Include="DisplayLib\ImplementationBase\FontSurfaceImpl.cs" /> - <Compile Include="DisplayLib\ImplementationBase\FrameBufferImpl.cs" /> - <Compile Include="DisplayLib\ImplementationBase\IndexBufferImpl.cs" /> - <Compile Include="DisplayLib\ImplementationBase\ShaderCompilerImpl.cs" /> - <Compile Include="DisplayLib\ImplementationBase\SurfaceImpl.cs" /> - <Compile Include="DisplayLib\ImplementationBase\VertexBufferImpl.cs" /> - <Compile Include="DisplayLib\IndexBuffer.cs" /> - <Compile Include="DisplayLib\ISurface.cs" /> - <Compile Include="DisplayLib\Origin.cs" /> - <Compile Include="DisplayLib\OriginAlignment.cs" /> - <Compile Include="DisplayLib\PixelBuffer.cs" /> - <Compile Include="DisplayLib\PixelFormat.cs" /> - <Compile Include="DisplayLib\PrimitiveType.cs" /> - <Compile Include="DisplayLib\RenderStateAdapter.cs" /> - <Compile Include="DisplayLib\ScreenMode.cs" /> - <Compile Include="DisplayLib\Shaders\AgateBuiltInShaders.cs" /> - <Compile Include="DisplayLib\Shaders\AgateShader.cs" /> - <Compile Include="DisplayLib\Shaders\AgateShaderCompileError.cs" /> - <Compile Include="DisplayLib\Shaders\Basic2DShader.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\Basic2DImpl.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\Effect.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\ShaderCompiler.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\ShaderLanguage.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\ShaderProgram.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\Technique.cs" /> - <Compile Include="DisplayLib\Shaders\Implementation\UniformState.cs" /> - <Compile Include="DisplayLib\Shaders\Lighting2D.cs" /> - <Compile Include="DisplayLib\Shaders\Lighting3D.cs" /> - <Compile Include="DisplayLib\StringTransformer.cs" /> - <Compile Include="DisplayLib\Surface.cs" /> - <Compile Include="DisplayLib\SurfaceState.cs" /> - <Compile Include="DisplayLib\TextLayout.cs" /> - <Compile Include="DisplayLib\VertexBuffer.cs" /> - <Compile Include="Drivers\AgateDriverInfo.cs" /> - <Compile Include="Drivers\AgateDriverReporter.cs" /> - <Compile Include="Drivers\AgateSandBoxLoader.cs" /> - <Compile Include="Drivers\DriverImplBase.cs" /> - <Compile Include="Drivers\IDesktopDriver.cs" /> - <Compile Include="Drivers\IUserSetSystems.cs" /> - <Compile Include="Drivers\NullInputImpl.cs" /> - <Compile Include="Drivers\NullSoundImpl.cs" /> - <Compile Include="Drivers\Registrar.cs" /> - <Compile Include="Drivers\TypeID.cs" /> - <Compile Include="CompatibilityExtensions\Numerics.cs" /> - <Compile Include="CompatibilityExtensions\FakeAttributes.cs" /> - <Compile Include="Geometry\Builders\Cube.cs" /> - <Compile Include="Geometry\Builders\Terrain.cs" /> - <Compile Include="Geometry\Color.cs" /> - <Compile Include="Geometry\Gradient.cs" /> - <Compile Include="Geometry\Matrix4x4.cs" /> - <Compile Include="Geometry\Point.cs" /> - <Compile Include="Geometry\PointF.cs" /> - <Compile Include="Geometry\Rectangle.cs" /> - <Compile Include="Geometry\RectangleF.cs" /> - <Compile Include="Geometry\Size.cs" /> - <Compile Include="Geometry\SizeF.cs" /> - <Compile Include="Geometry\TypeConverters.cs" /> - <Compile Include="Geometry\Vector2.cs" /> - <Compile Include="Geometry\Vector3.cs" /> - <Compile Include="Geometry\Vector4.cs" /> - <Compile Include="Geometry\VertexTypes\PositionColor.cs" /> - <Compile Include="Geometry\VertexTypes\PositionTextureColor.cs" /> - <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" /> - <Compile Include="Geometry\VertexTypes\PositionTextureNormal.cs" /> - <Compile Include="Geometry\VertexTypes\PositionTextureNormalTangent.cs" /> - <Compile Include="Geometry\VertexTypes\PositionTextureNTB.cs" /> - <Compile Include="Geometry\VertexTypes\VertexLayout.cs" /> - <Compile Include="Gui\AgateGuiException.cs" /> - <Compile Include="Gui\Button.cs" /> - <Compile Include="Gui\Cache\WidgetCache.cs" /> - <Compile Include="Gui\CheckBox.cs" /> - <Compile Include="Gui\ComboBox.cs" /> - <Compile Include="Gui\Container.cs" /> - <Compile Include="Gui\GuiRoot.cs" /> - <Compile Include="Gui\IGuiThemeEngine.cs" /> - <Compile Include="Gui\ILayoutPerformer.cs" /> - <Compile Include="Gui\Label.cs" /> - <Compile Include="Gui\LayoutExpand.cs" /> - <Compile Include="Gui\Layout\BoxLayoutBase.cs" /> - <Compile Include="Gui\Layout\Grid.cs" /> - <Compile Include="Gui\Layout\HorizontalBox.cs" /> - <Compile Include="Gui\Layout\VerticalBox.cs" /> - <Compile Include="Gui\ListBox.cs" /> - <Compile Include="Gui\Panel.cs" /> - <Compile Include="Gui\RadioButton.cs" /> - <Compile Include="Gui\ScrollBar.cs" /> - <Compile Include="Gui\TextBox.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\Cache\ScrollBarCache.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\Cache\TextBoxCache.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\Mercury.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryButton.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryCheckBox.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryGuiRoot.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryLabel.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryListBox.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryPanel.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryScheme.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryScrollBar.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryTextBox.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryWidget.cs" /> - <Compile Include="Gui\ThemeEngines\Mercury\MercuryWindow.cs" /> - <Compile Include="Gui\Widget.cs" /> - <Compile Include="Gui\WidgetList.cs" /> - <Compile Include="Gui\Window.cs" /> - <Compile Include="IFileProvider.cs" /> - <Compile Include="InputLib\ImplementationBase\InputImpl.cs" /> - <Compile Include="InputLib\ImplementationBase\JoystickImpl.cs" /> - <Compile Include="InputLib\InputEventArgs.cs" /> - <Compile Include="InputLib\Joystick.cs" /> - <Compile Include="InputLib\JoystickInput.cs" /> - <Compile Include="InputLib\Keyboard.cs" /> - <Compile Include="InputLib\KeyCode.cs" /> - <Compile Include="InputLib\KeyModifiers.cs" /> - <Compile Include="InputLib\Mouse.cs" /> - <Compile Include="InternalResources\Data.cs" /> - <Compile Include="InternalResources\DataResources.Designer.cs" /> - <Compile Include="IPlatform.cs" /> - <Compile Include="Meshes\Loaders\OBJFileRepresentation.cs" /> - <Compile Include="Meshes\Loaders\Obj\OBJFileRepresentation.cs" /> - <Compile Include="Meshes\Loaders\Obj\Parser.cs" /> - <Compile Include="Meshes\Loaders\Obj\TokenTypes.cs" /> - <Compile Include="Particles\Emitters\PixelEmitter.cs" /> - <Compile Include="Particles\Emitters\SpriteEmitter.cs" /> - <Compile Include="Particles\Emitters\SurfaceEmitter.cs" /> - <Compile Include="Particles\Manipulators\FadeOutManipulator.cs" /> - <Compile Include="Particles\Manipulators\GravityManipulator.cs" /> - <Compile Include="Particles\Manipulators\GravityPointManipulator.cs" /> - <Compile Include="Particles\Particle.cs" /> - <Compile Include="Particles\ParticleEmitter.cs" /> - <Compile Include="Particles\Particles\PixelParticle.cs" /> - <Compile Include="Particles\Particles\SpriteParticle.cs" /> - <Compile Include="Particles\Particles\SurfaceParticle.cs" /> - <Compile Include="PlatformType.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Resources\AgateResource.cs" /> - <Compile Include="Resources\AgateResourceCollection.cs" /> - <Compile Include="Resources\AgateResourceException.cs" /> - <Compile Include="Resources\AgateResourceLoader.cs" /> - <Compile Include="Resources\BitmapFontResource.cs" /> - <Compile Include="Resources\DisplayWindowResource.cs" /> - <Compile Include="Resources\SpriteResource.cs" /> - <Compile Include="Resources\StringTable.cs" /> - <Compile Include="Resources\SurfaceResource.cs" /> - <Compile Include="Resources\XmlHelper.cs" /> - <Compile Include="Serialization\Formatters\Xml\XmlFormatter.cs" /> - <Compile Include="Serialization\Xle\CompressionType.cs" /> - <Compile Include="Serialization\Xle\ITypeBinder.cs" /> - <Compile Include="Serialization\Xle\IXleSerializable.cs" /> - <Compile Include="Serialization\Xle\TypeBinder.cs" /> - <Compile Include="Serialization\Xle\XleSerializationException.cs" /> - <Compile Include="Serialization\Xle\XleSerializationInfo.cs" /> - <Compile Include="Serialization\Xle\XleSerializer.cs" /> - <Compile Include="Settings\PersistantSettings.cs" /> - <Compile Include="Settings\SettingsGroup.cs" /> - <Compile Include="Sprites\FrameList.cs" /> - <Compile Include="Sprites\IFrameList.cs" /> - <Compile Include="Sprites\ISprite.cs" /> - <Compile Include="Sprites\ISpriteFrame.cs" /> - <Compile Include="Sprites\Sprite.cs" /> - <Compile Include="Sprites\SpriteFrame.cs" /> - <Compile Include="Timing.cs" /> - <Compile Include="Utility\FileProviderList.cs" /> - <Compile Include="Utility\FileSystemProvider.cs" /> - <Compile Include="Utility\Platform.cs" /> - <Compile Include="Utility\Ref.cs" /> - <Compile Include="Utility\SurfacePacker.cs" /> - <Compile Include="Utility\TgzFileProvider.cs" /> - <Compile Include="Utility\ZipFileProvider.cs" /> - <Compile Include="CompatibilityExtensions\XboxExtensions.cs" /> - </ItemGroup> - <ItemGroup> - <NestedContentProject Include="Content\Content.contentproj"> - <Project>cb57c4be-41f0-4674-a282-fd960f64b793</Project> - <Visible>False</Visible> - </NestedContentProject> - </ItemGroup> - <ItemGroup> - <Content Include="Drivers\improve_registrar.txt" /> - </ItemGroup> - <ItemGroup> - <None Include="InternalResources\agate-black-gui.zip" /> - <None Include="InternalResources\Fonts.zip" /> - <None Include="InternalResources\images.tar.gz" /> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="InternalResources\DataResources.resx" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file Deleted: branches/xna/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs =================================================================== --- branches/xna/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs 2010-02-04 20:39:40 UTC (rev 1231) +++ branches/xna/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs 2010-02-04 22:48:10 UTC (rev 1232) @@ -1,57 +0,0 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AgateLib.DisplayLib.Shaders -{ - /// <summary> - /// Exception raised when there is an error with the shader compiler. - /// </summary> - [global::System.Serializable] - public class AgateShaderCompilerException : AgateException - { - /// <summary> - /// Constructs an AgateShaderCompilerException object. - /// </summary> - public AgateShaderCompilerException() { } - /// <summary> - /// Constructs an AgateShaderCompilerException object. - /// </summary> - /// <param name="message"></param> - public AgateShaderCompilerException(string message) : base(message) { } - /// <summary> - /// Constructs an AgateShaderCompilerException object. - /// </summary> - /// <param name="inner"></param> - /// <param name="message"></param> - public AgateShaderCompilerException(string message, Exception inner) : base(message, inner) { } - /// <summary> - /// Constructs an AgateShaderCompilerException object. - /// </summary> - /// <param name="context"></param> - /// <param name="info"></param> - protected AgateShaderCompilerException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) - : base(info, context) { } - } -} Added: branches/xna/AgateXbox.sln =================================================================== --- branches/xna/AgateXbox.sln (rev 0) +++ branches/xna/AgateXbox.sln 2010-02-04 22:48:10 UTC (rev 1232) @@ -0,0 +1,54 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateXbox", "AgateLib\AgateLibXbox.csproj", "{F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLibXna", "AgateLib\AgateLibXna.csproj", "{AFD7F131-9954-41C2-852E-0BB68F44E80F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Debug|Xbox 360 = Debug|Xbox 360 + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + Release|Xbox 360 = Release|Xbox 360 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Debug|x86.ActiveCfg = Debug|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|x86.ActiveCfg = Release|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 + {F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}.Release|Xbox 360.Build.0 = Release|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|x86.ActiveCfg = Debug|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|x86.ActiveCfg = Release|Xbox 360 + {CB57C4BE-41F0-4674-A282-FD960F64B793}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|x86.ActiveCfg = Debug|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|x86.Build.0 = Debug|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|Mixed Platforms.Build.0 = Release|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|x86.ActiveCfg = Release|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|x86.Build.0 = Release|x86 + {AFD7F131-9954-41C2-852E-0BB68F44E80F}.Release|Xbox 360.ActiveCfg = Release|x86 + {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Debug|x86.ActiveCfg = Debug|x86 + {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Release|x86.ActiveCfg = Release|x86 + {D562C72E-576E-4E8C-8DC1-85365A173EDC}.Release|Xbox 360.ActiveCfg = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-04 20:39:49
|
Revision: 1231 http://agate.svn.sourceforge.net/agate/?rev=1231&view=rev Author: kanato Date: 2010-02-04 20:39:40 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Initial conversion of AgateLib to compile on the XBox 360. Modified Paths: -------------- branches/xna/AgateLib/AgateException.cs branches/xna/AgateLib/AgateFileProvider.cs branches/xna/AgateLib/AgateLib.csproj branches/xna/AgateLib/AudioLib/Audio.cs branches/xna/AgateLib/Core.cs branches/xna/AgateLib/Data/AgateColumn.cs branches/xna/AgateLib/Data/AgateDataHelper.cs branches/xna/AgateLib/Data/AgateDatabaseException.cs branches/xna/AgateLib/Data/AgateRow.cs branches/xna/AgateLib/Data/AgateTable.cs branches/xna/AgateLib/DisplayLib/FontSurface.cs branches/xna/AgateLib/DisplayLib/PixelBuffer.cs branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs branches/xna/AgateLib/Drivers/Registrar.cs branches/xna/AgateLib/Geometry/Color.cs branches/xna/AgateLib/Geometry/Rectangle.cs branches/xna/AgateLib/Geometry/Size.cs branches/xna/AgateLib/Geometry/TypeConverters.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs branches/xna/AgateLib/Gui/AgateGuiException.cs branches/xna/AgateLib/Gui/GuiRoot.cs branches/xna/AgateLib/InputLib/Mouse.cs branches/xna/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs branches/xna/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs branches/xna/AgateLib/Meshes/Loaders/Obj/Parser.cs branches/xna/AgateLib/Properties/AssemblyInfo.cs branches/xna/AgateLib/Resources/AgateResourceException.cs branches/xna/AgateLib/Resources/AgateResourceLoader.cs branches/xna/AgateLib/Serialization/Formatters/Xml/XmlFormatter.cs branches/xna/AgateLib/Serialization/Xle/TypeBinder.cs branches/xna/AgateLib/Serialization/Xle/XleSerializationException.cs branches/xna/AgateLib/Serialization/Xle/XleSerializationInfo.cs branches/xna/AgateLib/Serialization/Xle/XleSerializer.cs branches/xna/AgateLib/Utility/FileProviderList.cs branches/xna/AgateLib/Utility/FileSystemProvider.cs branches/xna/AgateLib/Utility/TgzFileProvider.cs branches/xna/AgateLib/Utility/ZipFileProvider.cs branches/xna/Tests/Tests.csproj Added Paths: ----------- branches/xna/AgateLib/AgateXbox.csproj branches/xna/AgateLib/CompatibilityExtensions/ branches/xna/AgateLib/CompatibilityExtensions/Enums.cs branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs branches/xna/AgateLib/CompatibilityExtensions/XboxExtensions.cs branches/xna/AgateLib/IPlatform.cs branches/xna/AgateLib/Utility/Platform.cs Removed Paths: ------------- branches/xna/AgateLib/Drivers/improve_registrar.txt branches/xna/AgateLib/Platform.cs branches/xna/AgateLib/Utility/Platform.cs Modified: branches/xna/AgateLib/AgateException.cs =================================================================== --- branches/xna/AgateLib/AgateException.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/AgateException.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -58,6 +58,7 @@ public AgateException(Exception inner, string format, params object[] args) : base(string.Format(format, args), inner) { } +#if !XBOX360 /// <summary> /// Deserializes an AgateException. /// </summary> @@ -65,6 +66,7 @@ System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } +#endif } /// <summary> @@ -94,6 +96,7 @@ /// Constructs a new AgateCrossPlatformException object. /// </summary> public AgateCrossPlatformException(string message, Exception inner) : base(message, inner) { } +#if !XBOX360 /// <summary> /// Constructs a new AgateCrossPlatformException object from serialization data. /// </summary> @@ -103,5 +106,6 @@ System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } +#endif } } \ No newline at end of file Modified: branches/xna/AgateLib/AgateFileProvider.cs =================================================================== --- branches/xna/AgateLib/AgateFileProvider.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/AgateFileProvider.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -44,6 +44,7 @@ static void Initialize() { +#if !XBOX360 string location = System.Reflection.Assembly.GetEntryAssembly().Location; mAssemblyProvider.Add(new FileSystemProvider(Path.GetDirectoryName(location))); @@ -51,6 +52,7 @@ mSoundProvider.Add(new FileSystemProvider(".")); mMusicProvider.Add(new FileSystemProvider(".")); mResourceProvider.Add(new FileSystemProvider(".")); +#endif } /// <summary> @@ -91,6 +93,7 @@ get { return mResourceProvider; } } +#if !XBOX360 /// <summary> /// Saves a stream to a file in the temp path. /// </summary> @@ -111,5 +114,6 @@ return tempfile; } +#endif } } Modified: branches/xna/AgateLib/AgateLib.csproj =================================================================== --- branches/xna/AgateLib/AgateLib.csproj 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/AgateLib.csproj 2010-02-04 20:39:40 UTC (rev 1231) @@ -139,6 +139,9 @@ <Compile Include="AudioLib\ImplementationBase\StreamingSoundBufferImpl.cs" /> <Compile Include="AudioLib\SoundFormat.cs" /> <Compile Include="AudioLib\StreamingSoundBuffer.cs" /> + <Compile Include="CompatibilityExtensions\Enums.cs" /> + <Compile Include="CompatibilityExtensions\Numerics.cs" /> + <Compile Include="CompatibilityExtensions\XboxExtensions.cs" /> <Compile Include="Core.cs"> <SubType>Code</SubType> </Compile> @@ -154,6 +157,7 @@ <Compile Include="Data\AgateTableDictionary.cs" /> <Compile Include="DisplayLib\FrameBuffer.cs" /> <Compile Include="DisplayLib\Shaders\AgateBuiltInShaders.cs" /> + <Compile Include="DisplayLib\Shaders\AgateShaderCompileError.cs" /> <Compile Include="DisplayLib\Shaders\Basic2DShader.cs" /> <Compile Include="DisplayLib\Shaders\AgateShader.cs" /> <Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" /> @@ -206,7 +210,8 @@ <SubType>Code</SubType> </Compile> <Compile Include="DisplayLib\ImplementationBase\FrameBufferImpl.cs" /> - <Compile Include="Platform.cs" /> + <Compile Include="IPlatform.cs" /> + <Compile Include="Utility\Platform.cs" /> <Compile Include="PlatformType.cs" /> <Compile Include="Serialization\Xle\CompressionType.cs" /> <Compile Include="Settings\SettingsGroup.cs" /> @@ -303,9 +308,6 @@ <Compile Include="DisplayLib\Cache\SurfaceStateCache.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="DisplayLib\Shaders\Implementation\AgateShaderCompileError.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="DisplayLib\Shaders\Implementation\Effect.cs"> <SubType>Code</SubType> </Compile> Added: branches/xna/AgateLib/AgateXbox.csproj =================================================================== --- branches/xna/AgateLib/AgateXbox.csproj (rev 0) +++ branches/xna/AgateLib/AgateXbox.csproj 2010-02-04 20:39:40 UTC (rev 1231) @@ -0,0 +1,312 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <ProjectGuid>{F8D0785D-64BD-46DA-A7F1-DC9A68EC7140}</ProjectGuid> + <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">Xbox 360</Platform> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>AgateLib</RootNamespace> + <AssemblyName>AgateLib</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <XnaFrameworkVersion>v3.1</XnaFrameworkVersion> + <XnaPlatform>Xbox 360</XnaPlatform> + <XnaCrossPlatformGroupID>bd8ab9e4-0d4e-43cb-be34-8a03144b40eb</XnaCrossPlatformGroupID> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Xbox 360' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Xbox 360\Debug</OutputPath> + <DefineConstants>DEBUG;TRACE;XBOX;XBOX360</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <XnaCompressContent>true</XnaCompressContent> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Xbox 360' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Xbox 360\Release</OutputPath> + <DefineConstants>TRACE;XBOX;XBOX360</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <NoStdLib>true</NoStdLib> + <UseVSHostingProcess>false</UseVSHostingProcess> + <XnaCompressContent>true</XnaCompressContent> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Xna.Framework"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.Xna.Framework.Game"> + <Private>False</Private> + </Reference> + <Reference Include="mscorlib"> + <Private>False</Private> + </Reference> + <Reference Include="System"> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml"> + <Private>False</Private> + </Reference> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AgateException.cs" /> + <Compile Include="AgateFileProvider.cs" /> + <Compile Include="AgateGame.cs" /> + <Compile Include="AgateSetup.cs" /> + <Compile Include="AppInitParameters.cs" /> + <Compile Include="AudioLib\Audio.cs" /> + <Compile Include="AudioLib\AudioCapsInfo.cs" /> + <Compile Include="AudioLib\ImplementationBase\AudioImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\MusicImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\SoundBufferImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\SoundBufferSessionImpl.cs" /> + <Compile Include="AudioLib\ImplementationBase\StreamingSoundBufferImpl.cs" /> + <Compile Include="AudioLib\Music.cs" /> + <Compile Include="AudioLib\SoundBuffer.cs" /> + <Compile Include="AudioLib\SoundBufferSession.cs" /> + <Compile Include="AudioLib\SoundFormat.cs" /> + <Compile Include="AudioLib\StreamingSoundBuffer.cs" /> + <Compile Include="BitmapFont\BitmapFontImpl.cs" /> + <Compile Include="BitmapFont\BitmapFontOptions.cs" /> + <Compile Include="BitmapFont\FontMetrics.cs" /> + <Compile Include="BitmapFont\GlyphMetrics.cs" /> + <Compile Include="CompatibilityExtensions\Enums.cs" /> + <Compile Include="Core.cs" /> + <Compile Include="Data\AgateColumn.cs" /> + <Compile Include="Data\AgateColumnDictionary.cs" /> + <Compile Include="Data\AgateDatabase.cs" /> + <Compile Include="Data\AgateDatabaseException.cs" /> + <Compile Include="Data\AgateDataHelper.cs" /> + <Compile Include="Data\AgateRow.cs" /> + <Compile Include="Data\AgateRowList.cs" /> + <Compile Include="Data\AgateTable.cs" /> + <Compile Include="Data\AgateTableDictionary.cs" /> + <Compile Include="Data\FieldType.cs" /> + <Compile Include="DisplayLib\Cache\FontStateCache.cs" /> + <Compile Include="DisplayLib\Cache\SurfaceStateCache.cs" /> + <Compile Include="DisplayLib\CreateWindowParams.cs" /> + <Compile Include="DisplayLib\Display.cs" /> + <Compile Include="DisplayLib\DisplayCapsInfo.cs" /> + <Compile Include="DisplayLib\DisplayWindow.cs" /> + <Compile Include="DisplayLib\FontState.cs" /> + <Compile Include="DisplayLib\FontSurface.cs" /> + <Compile Include="DisplayLib\FrameBuffer.cs" /> + <Compile Include="DisplayLib\ImplementationBase\DisplayImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\DisplayWindowImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\FontSurfaceImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\FrameBufferImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\IndexBufferImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\ShaderCompilerImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\SurfaceImpl.cs" /> + <Compile Include="DisplayLib\ImplementationBase\VertexBufferImpl.cs" /> + <Compile Include="DisplayLib\IndexBuffer.cs" /> + <Compile Include="DisplayLib\ISurface.cs" /> + <Compile Include="DisplayLib\Origin.cs" /> + <Compile Include="DisplayLib\OriginAlignment.cs" /> + <Compile Include="DisplayLib\PixelBuffer.cs" /> + <Compile Include="DisplayLib\PixelFormat.cs" /> + <Compile Include="DisplayLib\PrimitiveType.cs" /> + <Compile Include="DisplayLib\RenderStateAdapter.cs" /> + <Compile Include="DisplayLib\ScreenMode.cs" /> + <Compile Include="DisplayLib\Shaders\AgateBuiltInShaders.cs" /> + <Compile Include="DisplayLib\Shaders\AgateShader.cs" /> + <Compile Include="DisplayLib\Shaders\AgateShaderCompileError.cs" /> + <Compile Include="DisplayLib\Shaders\Basic2DShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Basic2DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Effect.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderCompiler.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderLanguage.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\ShaderProgram.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\Technique.cs" /> + <Compile Include="DisplayLib\Shaders\Implementation\UniformState.cs" /> + <Compile Include="DisplayLib\Shaders\Lighting2D.cs" /> + <Compile Include="DisplayLib\Shaders\Lighting3D.cs" /> + <Compile Include="DisplayLib\StringTransformer.cs" /> + <Compile Include="DisplayLib\Surface.cs" /> + <Compile Include="DisplayLib\SurfaceState.cs" /> + <Compile Include="DisplayLib\TextLayout.cs" /> + <Compile Include="DisplayLib\VertexBuffer.cs" /> + <Compile Include="Drivers\AgateDriverInfo.cs" /> + <Compile Include="Drivers\AgateDriverReporter.cs" /> + <Compile Include="Drivers\AgateSandBoxLoader.cs" /> + <Compile Include="Drivers\DriverImplBase.cs" /> + <Compile Include="Drivers\IDesktopDriver.cs" /> + <Compile Include="Drivers\IUserSetSystems.cs" /> + <Compile Include="Drivers\NullInputImpl.cs" /> + <Compile Include="Drivers\NullSoundImpl.cs" /> + <Compile Include="Drivers\Registrar.cs" /> + <Compile Include="Drivers\TypeID.cs" /> + <Compile Include="CompatibilityExtensions\Numerics.cs" /> + <Compile Include="CompatibilityExtensions\FakeAttributes.cs" /> + <Compile Include="Geometry\Builders\Cube.cs" /> + <Compile Include="Geometry\Builders\Terrain.cs" /> + <Compile Include="Geometry\Color.cs" /> + <Compile Include="Geometry\Gradient.cs" /> + <Compile Include="Geometry\Matrix4x4.cs" /> + <Compile Include="Geometry\Point.cs" /> + <Compile Include="Geometry\PointF.cs" /> + <Compile Include="Geometry\Rectangle.cs" /> + <Compile Include="Geometry\RectangleF.cs" /> + <Compile Include="Geometry\Size.cs" /> + <Compile Include="Geometry\SizeF.cs" /> + <Compile Include="Geometry\TypeConverters.cs" /> + <Compile Include="Geometry\Vector2.cs" /> + <Compile Include="Geometry\Vector3.cs" /> + <Compile Include="Geometry\Vector4.cs" /> + <Compile Include="Geometry\VertexTypes\PositionColor.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureColor.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNormal.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNormalTangent.cs" /> + <Compile Include="Geometry\VertexTypes\PositionTextureNTB.cs" /> + <Compile Include="Geometry\VertexTypes\VertexLayout.cs" /> + <Compile Include="Gui\AgateGuiException.cs" /> + <Compile Include="Gui\Button.cs" /> + <Compile Include="Gui\Cache\WidgetCache.cs" /> + <Compile Include="Gui\CheckBox.cs" /> + <Compile Include="Gui\ComboBox.cs" /> + <Compile Include="Gui\Container.cs" /> + <Compile Include="Gui\GuiRoot.cs" /> + <Compile Include="Gui\IGuiThemeEngine.cs" /> + <Compile Include="Gui\ILayoutPerformer.cs" /> + <Compile Include="Gui\Label.cs" /> + <Compile Include="Gui\LayoutExpand.cs" /> + <Compile Include="Gui\Layout\BoxLayoutBase.cs" /> + <Compile Include="Gui\Layout\Grid.cs" /> + <Compile Include="Gui\Layout\HorizontalBox.cs" /> + <Compile Include="Gui\Layout\VerticalBox.cs" /> + <Compile Include="Gui\ListBox.cs" /> + <Compile Include="Gui\Panel.cs" /> + <Compile Include="Gui\RadioButton.cs" /> + <Compile Include="Gui\ScrollBar.cs" /> + <Compile Include="Gui\TextBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Cache\ScrollBarCache.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Cache\TextBoxCache.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\Mercury.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryButton.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryCheckBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryGuiRoot.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryLabel.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryListBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryPanel.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryScheme.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryScrollBar.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryTextBox.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryWidget.cs" /> + <Compile Include="Gui\ThemeEngines\Mercury\MercuryWindow.cs" /> + <Compile Include="Gui\Widget.cs" /> + <Compile Include="Gui\WidgetList.cs" /> + <Compile Include="Gui\Window.cs" /> + <Compile Include="IFileProvider.cs" /> + <Compile Include="InputLib\ImplementationBase\InputImpl.cs" /> + <Compile Include="InputLib\ImplementationBase\JoystickImpl.cs" /> + <Compile Include="InputLib\InputEventArgs.cs" /> + <Compile Include="InputLib\Joystick.cs" /> + <Compile Include="InputLib\JoystickInput.cs" /> + <Compile Include="InputLib\Keyboard.cs" /> + <Compile Include="InputLib\KeyCode.cs" /> + <Compile Include="InputLib\KeyModifiers.cs" /> + <Compile Include="InputLib\Mouse.cs" /> + <Compile Include="InternalResources\Data.cs" /> + <Compile Include="InternalResources\DataResources.Designer.cs" /> + <Compile Include="IPlatform.cs" /> + <Compile Include="Meshes\Loaders\OBJFileRepresentation.cs" /> + <Compile Include="Meshes\Loaders\Obj\OBJFileRepresentation.cs" /> + <Compile Include="Meshes\Loaders\Obj\Parser.cs" /> + <Compile Include="Meshes\Loaders\Obj\TokenTypes.cs" /> + <Compile Include="Particles\Emitters\PixelEmitter.cs" /> + <Compile Include="Particles\Emitters\SpriteEmitter.cs" /> + <Compile Include="Particles\Emitters\SurfaceEmitter.cs" /> + <Compile Include="Particles\Manipulators\FadeOutManipulator.cs" /> + <Compile Include="Particles\Manipulators\GravityManipulator.cs" /> + <Compile Include="Particles\Manipulators\GravityPointManipulator.cs" /> + <Compile Include="Particles\Particle.cs" /> + <Compile Include="Particles\ParticleEmitter.cs" /> + <Compile Include="Particles\Particles\PixelParticle.cs" /> + <Compile Include="Particles\Particles\SpriteParticle.cs" /> + <Compile Include="Particles\Particles\SurfaceParticle.cs" /> + <Compile Include="PlatformType.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Resources\AgateResource.cs" /> + <Compile Include="Resources\AgateResourceCollection.cs" /> + <Compile Include="Resources\AgateResourceException.cs" /> + <Compile Include="Resources\AgateResourceLoader.cs" /> + <Compile Include="Resources\BitmapFontResource.cs" /> + <Compile Include="Resources\DisplayWindowResource.cs" /> + <Compile Include="Resources\SpriteResource.cs" /> + <Compile Include="Resources\StringTable.cs" /> + <Compile Include="Resources\SurfaceResource.cs" /> + <Compile Include="Resources\XmlHelper.cs" /> + <Compile Include="Serialization\Formatters\Xml\XmlFormatter.cs" /> + <Compile Include="Serialization\Xle\CompressionType.cs" /> + <Compile Include="Serialization\Xle\ITypeBinder.cs" /> + <Compile Include="Serialization\Xle\IXleSerializable.cs" /> + <Compile Include="Serialization\Xle\TypeBinder.cs" /> + <Compile Include="Serialization\Xle\XleSerializationException.cs" /> + <Compile Include="Serialization\Xle\XleSerializationInfo.cs" /> + <Compile Include="Serialization\Xle\XleSerializer.cs" /> + <Compile Include="Settings\PersistantSettings.cs" /> + <Compile Include="Settings\SettingsGroup.cs" /> + <Compile Include="Sprites\FrameList.cs" /> + <Compile Include="Sprites\IFrameList.cs" /> + <Compile Include="Sprites\ISprite.cs" /> + <Compile Include="Sprites\ISpriteFrame.cs" /> + <Compile Include="Sprites\Sprite.cs" /> + <Compile Include="Sprites\SpriteFrame.cs" /> + <Compile Include="Timing.cs" /> + <Compile Include="Utility\FileProviderList.cs" /> + <Compile Include="Utility\FileSystemProvider.cs" /> + <Compile Include="Utility\Platform.cs" /> + <Compile Include="Utility\Ref.cs" /> + <Compile Include="Utility\SurfacePacker.cs" /> + <Compile Include="Utility\TgzFileProvider.cs" /> + <Compile Include="Utility\ZipFileProvider.cs" /> + <Compile Include="CompatibilityExtensions\XboxExtensions.cs" /> + </ItemGroup> + <ItemGroup> + <NestedContentProject Include="Content\Content.contentproj"> + <Project>cb57c4be-41f0-4674-a282-fd960f64b793</Project> + <Visible>False</Visible> + </NestedContentProject> + </ItemGroup> + <ItemGroup> + <Content Include="Drivers\improve_registrar.txt" /> + </ItemGroup> + <ItemGroup> + <None Include="InternalResources\agate-black-gui.zip" /> + <None Include="InternalResources\Fonts.zip" /> + <None Include="InternalResources\images.tar.gz" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="InternalResources\DataResources.resx" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Modified: branches/xna/AgateLib/AudioLib/Audio.cs =================================================================== --- branches/xna/AgateLib/AudioLib/Audio.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/AudioLib/Audio.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -134,7 +134,7 @@ if (x == 0) return 0; else - return Math.Log(1000 * x, 1000); + return Math.Log(1000 * x) / Math.Log(1000); } /// <summary> /// This is for use by drivers whose underlying technology does not provide Added: branches/xna/AgateLib/CompatibilityExtensions/Enums.cs =================================================================== --- branches/xna/AgateLib/CompatibilityExtensions/Enums.cs (rev 0) +++ branches/xna/AgateLib/CompatibilityExtensions/Enums.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace AgateLib.CompatibilityExtensions +{ + class Enums + { + public static Array GetValues(Type enumType) + { +#if XBOX360 + if (enumType.IsEnum == false) + throw new AgateException("You must pass an enumeration type."); + + + FieldInfo[] fieldInfo = enumType.GetFields(BindingFlags.Public | BindingFlags.Static); + Enum[] vals = new Enum[fieldInfo.Length]; + + for (int i = 0; i < vals.Length; ++i) + { + vals[i] = (Enum)fieldInfo[i].GetValue(null); + } + + return vals; +#else + return Enum.GetValues(enumType); +#endif + } + + } +} \ No newline at end of file Added: branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs =================================================================== --- branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs (rev 0) +++ branches/xna/AgateLib/CompatibilityExtensions/FakeAttributes.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace System.ComponentModel +{ + // The attributes in this file are "fake" replacements for those + // found in the System.ComponentModel namespace. These allow the same + // code to compile for Windows and Xbox and take advantage of those attributes + // without having to have #if statements everywhere. +#if XBOX360 + [global::System.AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)] + sealed class BrowsableAttribute : Attribute + { + public BrowsableAttribute(bool unusued) + { + } + } + + [AttributeUsage(AttributeTargets.All)] + sealed class TypeConverterAttribute : Attribute + { + public TypeConverterAttribute(Type someType) + { } + } + + class ExpandableObjectConverter + { } +#endif +} \ No newline at end of file Added: branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs =================================================================== --- branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs (rev 0) +++ branches/xna/AgateLib/CompatibilityExtensions/Numerics.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; + +namespace AgateLib.CompatibilityExtensions +{ + public static class Numerics + { + public static bool TryParseInt32(string str, out int value) + { +#if XBOX360 + value = 0; + + try + { + value = int.Parse(str); + return true; + } + catch + { + return false; + } +#else + return int.TryParse(str, out value); +#endif + } + public static bool TryParseInt32(string str, NumberStyles style, IFormatProvider provider, out int value) + { +#if XBOX360 + throw new NotImplementedException(); +#else + return int.TryParse(str, style, provider, out value); +#endif + } + } + +} \ No newline at end of file Added: branches/xna/AgateLib/CompatibilityExtensions/XboxExtensions.cs =================================================================== --- branches/xna/AgateLib/CompatibilityExtensions/XboxExtensions.cs (rev 0) +++ branches/xna/AgateLib/CompatibilityExtensions/XboxExtensions.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.CompatibilityExtensions +{ +#if XBOX360 + /// <summary> + /// Provies replacements for useful functions that aren't in the XNA framework. + /// </summary> + public static class XboxExtensions + { + static List<string> stringBuffer = new List<string>(); + + public static string[] Split(this string str, char[] splitChars, StringSplitOptions options) + { + if (options == StringSplitOptions.None) + return str.Split(splitChars); + + if (options == StringSplitOptions.RemoveEmptyEntries) + { + stringBuffer.Clear(); + + stringBuffer.AddRange(str.Split(splitChars)); + + for (int i = 0; i < stringBuffer.Count; i++) + { + if (string.IsNullOrEmpty(stringBuffer[i])) + { + stringBuffer.RemoveAt(i); + i--; + } + } + + return stringBuffer.ToArray(); + } + + else + throw new ArgumentException("Could not understand options parameter."); + } + + public static string ToLowerInvariant(this string str) + { + return str.ToLower(System.Globalization.CultureInfo.InvariantCulture); + } + + //public static Type GetInterface(this Type obj, string name) + //{ + // return obj.GetInterfaces().FirstOrDefault(x => x.Name == name); + //} + } + + public enum StringSplitOptions + { + None, + RemoveEmptyEntries, + } +#endif +} \ No newline at end of file Modified: branches/xna/AgateLib/Core.cs =================================================================== --- branches/xna/AgateLib/Core.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Core.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -90,7 +90,7 @@ private static bool mAutoPause = false; private static bool mIsActive = true; private static bool mInititalized = false; - private static Platform mPlatform; + private static IPlatform mPlatform; private static PersistantSettings mSettings; @@ -300,7 +300,11 @@ static Core() { - mPlatform = new Platform(); +#if !XBOX360 + mPlatform = new Utility.Platform(); +#else + mPlatform = new Utility.XBox360Platform(); +#endif } /// <summary> /// Initializes Core class. @@ -320,7 +324,7 @@ /// <summary> /// Gets an object which describes details about the current platform. /// </summary> - public static Platform Platform + public static IPlatform Platform { get { return mPlatform; } } @@ -418,6 +422,7 @@ InputLib.JoystickInput.PollTimer(); } +#if !XBOX360 /// <summary> /// Returns the directory the application that was started resides in. /// </summary> @@ -428,6 +433,7 @@ return System.AppDomain.CurrentDomain.BaseDirectory; } } +#endif /// <summary> /// returns time since agatelib was initialized in milliseconds. Modified: branches/xna/AgateLib/Data/AgateColumn.cs =================================================================== --- branches/xna/AgateLib/Data/AgateColumn.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Data/AgateColumn.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using AgateLib.Serialization.Xle; -using System.ComponentModel; +using AgateLib.Utility; namespace AgateLib.Data { Modified: branches/xna/AgateLib/Data/AgateDataHelper.cs =================================================================== --- branches/xna/AgateLib/Data/AgateDataHelper.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Data/AgateDataHelper.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -104,7 +104,6 @@ return data.ToArray(); } - internal static string CreatePrefixedLine(string p, params object[] values) { StringBuilder b = new StringBuilder(); Modified: branches/xna/AgateLib/Data/AgateDatabaseException.cs =================================================================== --- branches/xna/AgateLib/Data/AgateDatabaseException.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Data/AgateDatabaseException.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -65,6 +65,7 @@ ErrorCount = errorCount; } +#if !XBOX360 /// <summary> /// Constructs a database exception. /// </summary> @@ -74,6 +75,7 @@ System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } +#endif internal int ErrorCount { get; set; } } Modified: branches/xna/AgateLib/Data/AgateRow.cs =================================================================== --- branches/xna/AgateLib/Data/AgateRow.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Data/AgateRow.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -157,7 +157,8 @@ } } - Convert.ChangeType(mValues[column.Name], column.FieldTypeDataType); + Convert.ChangeType(mValues[column.Name], column.FieldTypeDataType, + System.Globalization.CultureInfo.InvariantCulture); } internal void ValidateData(AgateTable agateTable) Modified: branches/xna/AgateLib/Data/AgateTable.cs =================================================================== --- branches/xna/AgateLib/Data/AgateTable.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Data/AgateTable.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Text; +using AgateLib.CompatibilityExtensions; using AgateLib.Serialization.Xle; namespace AgateLib.Data Modified: branches/xna/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- branches/xna/AgateLib/DisplayLib/FontSurface.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/DisplayLib/FontSurface.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -22,6 +22,7 @@ using System.Text; using System.Text.RegularExpressions; using AgateLib.BitmapFont; +using AgateLib.CompatibilityExtensions; using AgateLib.DisplayLib.ImplementationBase; using AgateLib.Geometry; using AgateLib.Resources; @@ -516,7 +517,7 @@ spaceAboveLine = 0; } - else if (int.TryParse(argsIndexText.ToString(), out argsIndex)) + else if (Numerics.TryParseInt32(argsIndexText.ToString(), out argsIndex)) { if (argsIndex >= args.Length) { Modified: branches/xna/AgateLib/DisplayLib/PixelBuffer.cs =================================================================== --- branches/xna/AgateLib/DisplayLib/PixelBuffer.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/DisplayLib/PixelBuffer.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -20,7 +20,7 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; - +using AgateLib.CompatibilityExtensions; using AgateLib.Geometry; namespace AgateLib.DisplayLib @@ -48,7 +48,7 @@ /// </summary> static void TestPixelFormatStrides() { - foreach (PixelFormat format in Enum.GetValues(typeof(PixelFormat))) + foreach (PixelFormat format in Enums.GetValues(typeof(PixelFormat))) { if (format == PixelFormat.Any) continue; Modified: branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs =================================================================== --- branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -48,6 +48,8 @@ /// Constructs an AgateShaderCompilerException object. /// </summary> public AgateShaderCompilerException(string message, Exception inner) : base(message, inner) { } + +#if !XBOX360 /// <summary> /// Constructs an AgateShaderCompilerException object. /// </summary> @@ -55,5 +57,6 @@ System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } +#endif } } Modified: branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs =================================================================== --- branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Drivers/AgateSandBoxLoader.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -24,6 +24,7 @@ namespace AgateLib.Drivers { +#if !XBOX360 class AgateSandBoxLoader : MarshalByRefObject { public AgateDriverInfo[] ReportDrivers(string file) @@ -107,4 +108,5 @@ return retval.ToArray(); } } +#endif } \ No newline at end of file Modified: branches/xna/AgateLib/Drivers/Registrar.cs =================================================================== --- branches/xna/AgateLib/Drivers/Registrar.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Drivers/Registrar.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -83,6 +83,7 @@ if (mIsInitialized) return; +#if !XBOX360 RegisterNullDrivers(); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); @@ -135,8 +136,10 @@ SortDriverInfo(audioDrivers); SortDriverInfo(inputDrivers); SortDriverInfo(desktopDrivers); +#endif } +#if !XBOX360 private static void SortDriverInfo(List<AgateDriverInfo> driverList) { // sorts the driver list in reverse order. @@ -209,7 +212,7 @@ return false; } - +#endif /// <summary> /// Asks the user to select which drivers to use. /// </summary> @@ -396,6 +399,7 @@ return Activator.CreateInstance(driverType); } +#if !XBOX360 private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { AgateDriverInfo info = null; @@ -410,6 +414,7 @@ return LoadAssemblyLoadFrom(info); } +#endif private static Assembly LoadAssemblyLoadFrom(AgateDriverInfo info) { Deleted: branches/xna/AgateLib/Drivers/improve_registrar.txt =================================================================== --- branches/xna/AgateLib/Drivers/improve_registrar.txt 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Drivers/improve_registrar.txt 2010-02-04 20:39:40 UTC (rev 1231) @@ -1,7 +0,0 @@ -How does one load an assembly from a file using Assembly.Load? It seems like this has to be done with just the filename, without knowing the strong name for the assembly or anything. - -One doesn't oneself. :-) -Load the assemblies using Assembly.LoadFrom in a child AppDomain. Keep Assembly references in a Dictionary, keyed by the Assemblies' strong name. Subscribe to AppDomain.AssemblyResolve. This event will pass you the strong name of the type or resource that could not be found. Use it to obtain the strong name of the assembly. Fetch the Assembly reference from the Dictionary and return it, or return null. - -Now you explicitly push assemblies from the LoadFrom context into the Load context because you supply the Load context, which fails to bind a type by itself and calls the AssemblyResolve event, with the assembly directly. I'm not 100% sure, but my testing indicates that from that moment on the assembly reference is kept in cache in the Load context, meaning AssemblyResolve doesn't get called time and time again. - Modified: branches/xna/AgateLib/Geometry/Color.cs =================================================================== --- branches/xna/AgateLib/Geometry/Color.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/Color.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using AgateLib.CompatibilityExtensions; namespace AgateLib.Geometry { @@ -738,7 +739,7 @@ { int value; - if (int.TryParse(hex, System.Globalization.NumberStyles.HexNumber, null, out value)) + if (Numerics.TryParseInt32(hex, System.Globalization.NumberStyles.HexNumber, null, out value)) { if (value > 255 || value < 0) throw new ArgumentException(string.Format(System.Globalization.CultureInfo.CurrentCulture, Modified: branches/xna/AgateLib/Geometry/Rectangle.cs =================================================================== --- branches/xna/AgateLib/Geometry/Rectangle.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/Rectangle.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Text; +using AgateLib.CompatibilityExtensions; using AgateLib.Serialization.Xle; namespace AgateLib.Geometry @@ -448,7 +449,7 @@ int start = index + name.Length; - if (int.TryParse(text.Substring(start, comma - start), out value) == false) + if (Numerics.TryParseInt32(text.Substring(start, comma - start), out value) == false) return false; else return true; Modified: branches/xna/AgateLib/Geometry/Size.cs =================================================================== --- branches/xna/AgateLib/Geometry/Size.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/Size.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -197,7 +197,8 @@ /// <returns></returns> public static Size FromString(string text) { - return SizeConverter.ConvertFromString(null, System.Globalization.CultureInfo.CurrentCulture, text); + return SizeConverter.ConvertFromString(null, + System.Globalization.CultureInfo.CurrentCulture, text); } } Modified: branches/xna/AgateLib/Geometry/TypeConverters.cs =================================================================== --- branches/xna/AgateLib/Geometry/TypeConverters.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/TypeConverters.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Text; +using AgateLib.CompatibilityExtensions; namespace AgateLib.Geometry { @@ -28,39 +29,7 @@ /// </summary> class PointConverter : ExpandableObjectConverter { - /// <summary> - /// - /// </summary> - /// <param name="context"></param> - /// <param name="sourceType"></param> - /// <returns></returns> - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) - { - if (sourceType == typeof(string)) - { - return true; - } - return base.CanConvertFrom(context, sourceType); - } - /// <summary> - /// - /// </summary> - /// <param name="context"></param> - /// <param name="culture"></param> - /// <param name="value"></param> - /// <returns></returns> - public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) - { - string str = value as string; - if (str == null) - { - return base.ConvertFrom(context, culture, value); - } - - return ConvertFrom(context, culture, str); - } - /// <summary> /// /// </summary> @@ -68,7 +37,17 @@ /// <param name="culture"></param> /// <param name="str"></param> /// <returns></returns> - public new static Point ConvertFromString(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, string str) + public +#if !XBOX360 + new +#endif + static Point ConvertFromString( +#if XBOX360 + object unusued, +#else + ITypeDescriptorContext context, +#endif + System.Globalization.CultureInfo culture, string str) { if (str.StartsWith("{") && str.EndsWith("}")) str = str.Substring(1, str.Length - 2); @@ -101,12 +80,8 @@ } } - } - /// <summary> - /// - /// </summary> - class SizeConverter : ExpandableObjectConverter - { +#if !XBOX360 + /// <summary> /// /// </summary> @@ -133,11 +108,22 @@ string str = value as string; if (str == null) + { return base.ConvertFrom(context, culture, value); + } - return ConvertFromString(str); + return ConvertFrom(context, culture, str); + } - } + +#endif + + } + /// <summary> + /// + /// </summary> + class SizeConverter : ExpandableObjectConverter + { /// <summary> /// /// </summary> @@ -145,7 +131,17 @@ /// <param name="culture"></param> /// <param name="str"></param> /// <returns></returns> - public new static Size ConvertFromString(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, string str) + public +#if !XBOX360 + new +#endif + static Size ConvertFromString( +#if XBOX360 + object unusued, +#else + ITypeDescriptorContext context, +#endif + System.Globalization.CultureInfo culture, string str) { if (str.StartsWith("{") && str.EndsWith("}")) { @@ -186,9 +182,8 @@ } return retval; } - } - class RectangleConverter : ExpandableObjectConverter - { + +#if !XBOX360 /// <summary> /// /// </summary> @@ -218,8 +213,14 @@ return base.ConvertFrom(context, culture, value); return ConvertFromString(str); + } +#endif + } + class RectangleConverter : ExpandableObjectConverter + { + /// <summary> /// /// </summary> @@ -227,7 +228,17 @@ /// <param name="culture"></param> /// <param name="str"></param> /// <returns></returns> - public new static Rectangle ConvertFromString(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, string str) + public +#if !XBOX360 + new +#endif + static Rectangle ConvertFromString( +#if XBOX360 + object unusued, +#else + ITypeDescriptorContext context, +#endif + System.Globalization.CultureInfo culture, string str) { if (str.StartsWith("{") && str.EndsWith("}")) { @@ -283,5 +294,38 @@ int value = int.Parse(text.Substring(equals + 1), System.Globalization.CultureInfo.CurrentCulture); return value; } +#if !XBOX360 + /// <summary> + /// + /// </summary> + /// <param name="context"></param> + /// <param name="sourceType"></param> + /// <returns></returns> + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + if (sourceType == typeof(string)) + { + return true; + } + return base.CanConvertFrom(context, sourceType); + } + /// <summary> + /// + /// </summary> + /// <param name="context"></param> + /// <param name="culture"></param> + /// <param name="value"></param> + /// <returns></returns> + public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) + { + string str = value as string; + + if (str == null) + return base.ConvertFrom(context, culture, value); + + return ConvertFromString(str); + } + +#endif } } Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionColor.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -9,7 +9,11 @@ /// <summary> /// Vertex layout which only contains position and color information. /// </summary> - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential +#if !XBOX360 + , Pack = 1 +#endif + )] public struct PositionColor { /// <summary> Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -9,7 +9,11 @@ /// <summary> /// Vertex structure with position, texture and color values /// </summary> - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential +#if !XBOX360 + , Pack = 1 +#endif +)] public struct PositionTextureColor { /// <summary> Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -9,7 +9,11 @@ /// <summary> /// Vertex structure with position, texture and normal values. /// </summary> - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential +#if !XBOX360 + , Pack = 1 +#endif +)] public struct PositionTextureColorNormal { /// <summary> Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -9,7 +9,11 @@ /// <summary> /// Vertex structure with position, texture coordinates, normal, tangent, bitangent. /// </summary> - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential +#if !XBOX360 + , Pack = 1 +#endif +)] public struct PositionTextureNTB { /// <summary> Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -9,7 +9,11 @@ /// <summary> /// Vertex structure with position, texture and normal values. /// </summary> - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential +#if !XBOX360 + , Pack = 1 +#endif +)] public struct PositionTextureNormal { /// <summary> Modified: branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs =================================================================== --- branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -9,7 +9,11 @@ /// <summary> /// Vertex structure with position, texture coordinates, normal and tangent. /// </summary> - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential +#if !XBOX360 + , Pack = 1 +#endif +)] public struct PositionTextureNormalTangent { /// <summary> Modified: branches/xna/AgateLib/Gui/AgateGuiException.cs =================================================================== --- branches/xna/AgateLib/Gui/AgateGuiException.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Gui/AgateGuiException.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -45,6 +45,7 @@ /// <param name="message"></param> /// <param name="inner"></param> public AgateGuiException(string message, Exception inner) : base(message, inner) { } +#if !XBOX360 /// <summary> /// Constructs a new AgateGuiException. /// </summary> @@ -54,6 +55,7 @@ System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } +#endif } } Modified: branches/xna/AgateLib/Gui/GuiRoot.cs =================================================================== --- branches/xna/AgateLib/Gui/GuiRoot.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Gui/GuiRoot.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -257,7 +257,7 @@ } else { - Debug.Print("Sending mouse down to {0}", child); + Debug.WriteLine(string.Format("Sending mouse down to {0}", child)); if (child.AcceptFocusOnMouseDown) { FocusControl = child; @@ -277,7 +277,7 @@ OnMouseUp(e); else { - Debug.Print("Sending mouse up to {0}", directMouseInput); + Debug.WriteLine(string.Format("Sending mouse up to {0}", directMouseInput)); directMouseInput.SendMouseUp(e); } Added: branches/xna/AgateLib/IPlatform.cs =================================================================== --- branches/xna/AgateLib/IPlatform.cs (rev 0) +++ branches/xna/AgateLib/IPlatform.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -0,0 +1,13 @@ +using System; +namespace AgateLib +{ + public interface IPlatform + { + string AppDataDirectory { get; } + void EnsureAppDataDirectoryExists(); + AgateLib.PlatformType PlatformType { get; } + AgateLib.DotNetRuntime Runtime { get; } + void SetFolderPaths(string companyName, string appName); + AgateLib.WindowsVersion WindowsVersion { get; } + } +} Modified: branches/xna/AgateLib/InputLib/Mouse.cs =================================================================== --- branches/xna/AgateLib/InputLib/Mouse.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/InputLib/Mouse.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -19,7 +19,7 @@ using System; using System.Collections.Generic; using System.Text; - +using AgateLib.CompatibilityExtensions; using AgateLib.Geometry; namespace AgateLib.InputLib @@ -71,7 +71,7 @@ /// </summary> public class MouseState { - bool[] mMouseButtons = new bool[Enum.GetValues(typeof(MouseButtons)).Length]; + bool[] mMouseButtons = new bool[Enums.GetValues(typeof(MouseButtons)).Length]; internal MouseState() { Modified: branches/xna/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs =================================================================== (Binary files differ) Modified: branches/xna/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs =================================================================== (Binary files differ) Modified: branches/xna/AgateLib/Meshes/Loaders/Obj/Parser.cs =================================================================== (Binary files differ) Deleted: branches/xna/AgateLib/Platform.cs =================================================================== --- branches/xna/AgateLib/Platform.cs 2010-02-04 19:28:30 UTC (rev 1230) +++ branches/xna/AgateLib/Platform.cs 2010-02-04 20:39:40 UTC (rev 1231) @@ -1,366 +0,0 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2009. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using System.Reflection; -using System.Runtime.InteropServices; - -namespace AgateLib -{ - /// <summary> - /// Class which contains known information about the platform. - /// This class also contains the folders where the application should store its data, - /// which are automatically created from the AssemblyCompanhy and AssemblyProduct - /// attributes for the assembly where the entry point for the application is. - /// </summary> - public class Platform - { - PlatformType mType; - DotNetRuntime mRuntime; - WindowsVersion mWindowsVersion; - string mDocuments; - string mAppData; - string mAppDir; - bool m64Bit; - - internal Platform() - { - mType = DetectPlatformType(); - mRuntime = DetectRuntime(); - m64Bit = Detect64Bit(); - - if (PlatformType != PlatformType.Windows) - { - Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); - Trace.Listeners.Add(new TextWriterTraceListener(Console.Out)); - } - - CheckOSVersion(); - - if (mType == PlatformType.Windows) - mWindowsVersion = DetectWindowsVersion(); - - SetFolders(); - - string debugLog = "agate-debuglog.txt"; - string traceLog = "debuglog.txt"; - - if (HasWriteAccessToAppDirectory()) - { - debugLog = Path.Combine(mAppDir, debugLog); - traceLog = Path.Combine(mAppDir, traceLog); - } - else - { - debugLog = Path.Combine(mAppData, debugLog); - traceLog = Path.Combine(mAppData, traceLog); - } - - try - { - Debug.Listeners.Add(new TextWriterTraceListener(new StreamWriter(debugLog))); - Trace.Listeners.Add(new TextWriterTraceListener(new StreamWriter(traceLog))); - } - catch (Exception) - { - Trace.WriteLine("Could not open debug or trace log for writing."); - } - - Trace.WriteLine("64-bit platform: " + m64Bit.ToString()); - } - - private bool Detect64Bit() - { - int size = Marshal.SizeOf(typeof(IntPtr)); - - switch (size) - { - case 4: return false; - case 8: return true; - default: - throw new AgateException(string.Format("Size of IntPtr is {0}.", size)); - } - } - - private bool HasWriteAccessToAppDirectory() - { - // TODO: Maybe there is a better way to inspect permissions? - // here we just stry to write and see if we fail. - string filename = Path.GetTempFileName(); - - try - { - string targetFile = Path.Combine(mAppDir, Path.GetFileName(filename)); - - using (var w = new StreamWriter(targetFile)) - { - w.WriteLine("x"); - } - - File.Delete(targetFile); - return true; - } - catch - { - return false; - } - } - - internal void EnsureAppDataDirectoryExists() - { - if (Directory.Exists(AppDataDirectory)) - return; - - Directory.CreateDirectory(AppDataDirectory); - } - - /// <summary> - /// Gets the directory where the application should store its configuration data. - /// </summary> - public string AppDataDirectory - { - get { return mAppData; } - } - - static T GetCustomAttribute<T>(Assembly ass) where T : Attribute - { - try - { - return ass.GetCustomAttributes(typeof(T), false)[0] as T; - } - catch - { - return null; - } - } - private void SetFolders() - { - Assembly entryPt = Assembly.GetEntryAssembly(); - string fqn = entryPt.GetLoadedModules()[0].FullyQualifiedName; - - var companyAttribute = GetCustomAttribute<AssemblyCompanyAttribute>(entryPt); - var nameAttribute = GetCustomAttribute<AssemblyProductAttribute>(entryPt); - - mAppDir = Path.GetDirectoryName(fqn); - Console.WriteLine("App Dir: {0}", mAppDir); - - string companyName = companyAttribute != null ? companyAttribute.Company : string.Empty; - string product = nameAttribute != null ? nameAttribute.Product : string.Empty; - - SetFolderPaths(companyName, product); - } - - /// <summary> - /// Sets the folder paths for data based on the company name and application name. - /// This only needs to be called if the values used in the AssemblyCompany and - /// AssemblyProduct are not what you want to use to define these locations. - /// </summary> - /// <param name="companyName"></param> - /// <param name="appName"></param> - public void SetFolderPaths(string companyName, string appName) - { - string combDir = Path.Combine(companyName, appName); - - if (string.IsNullOrEmpty(combDir)) - { - mAppData = mAppDir; - Trace.WriteLine("Warning: No assembly level company / product name attributes were found."); - } - else - mAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - - mDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - - mAppData = Path.Combine(mAppData, combDir); - mDocuments = Path.Combine(mDocuments, combDir); - - Console.WriteLine("App Data: {0}", mAppData); - Console.WriteLine("Documents: {0}", mDocuments); - - } - - private DotNetRuntime DetectRuntime() - { - DotNetRuntime runtime = D... [truncated message content] |
From: <ka...@us...> - 2010-02-04 20:09:42
|
Revision: 1229 http://agate.svn.sourceforge.net/agate/?rev=1229&view=rev Author: kanato Date: 2010-02-04 19:11:57 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Create XNA branch. Added Paths: ----------- branches/xna/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-04 19:28:45
|
Revision: 1230 http://agate.svn.sourceforge.net/agate/?rev=1230&view=rev Author: kanato Date: 2010-02-04 19:28:30 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Add missing GuiTests/Transitions.cs file. Added Paths: ----------- trunk/Tests/GuiTests/Transitions.cs Added: trunk/Tests/GuiTests/Transitions.cs =================================================================== --- trunk/Tests/GuiTests/Transitions.cs (rev 0) +++ trunk/Tests/GuiTests/Transitions.cs 2010-02-04 19:28:30 UTC (rev 1230) @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.DisplayLib; +using AgateLib.Geometry; +using AgateLib; +using AgateLib.Gui; +using AgateLib.Gui.Layout; +using AgateLib.InputLib; + +namespace Tests.GuiTests +{ + class Transitions : AgateGame, IAgateTest + { + public void Main(string[] args) + { + new Transitions().Run(args); + } + protected override string ApplicationTitle + { + get + { + return "Gui Transition Tester"; + } + } + protected override void AdjustAppInitParameters(ref AppInitParameters initParams) + { + initParams.ShowSplashScreen = false; + } + + protected override void Initialize() + { + this.GuiRoot = new GuiRoot(); + + CreateGui(); + } + + Label fps; + Label infoLabel; + Button hideMouse; + Button hideLeftPanel; + Button hideRightPanel; + + protected override void Update(double time_ms) + { + fps.Text = Display.FramesPerSecond.ToString(); + + infoLabel.Text = "Control has focus: "; + + if (GuiRoot.FocusControl != null) + infoLabel.Text += GuiRoot.FocusControl; + } + + protected override void Render() + { + Display.Clear(Color.FromArgb(50, 0, 0)); + } + + private void CreateGui() + { + //ThemeEngines.Graphite.Graphite.DebugOutlines = true; + Label info = new Label("chonk"); + + Panel topPanel = new Panel { Name = "topPanel" }; + Panel bottomPanel = new Panel { Name = "bottomPanel" }; + + Panel leftPanel = new Panel { Name = "leftPanel" }; + Panel rightPanel = new Panel { Name = "rightPanel" }; + + for (int i = 0; i < 4; i++) + { + rightPanel.Children.Add(new CheckBox("Check " + i.ToString())); + leftPanel.Children.Add(new Button("Button Left " + i.ToString())); + } + + hideMouse = leftPanel.Children[0] as Button; + hideMouse.Text = "Hide Mouse Pointer"; + hideMouse.Click += new EventHandler(hideMouse_Click); + hideMouse.Enabled = true; + + leftPanel.Children.Add(new TextBox { Text = "Blank" }); + leftPanel.Children.Add(new TextBox { Enabled = false, Text = "Disabled" }); + + CheckBox vsync = new CheckBox("VSync"); + vsync.CheckChanged += new EventHandler(vsync_CheckChanged); + vsync_CheckChanged(this, EventArgs.Empty); + + rightPanel.Children.Add(vsync); + rightPanel.Children.Add(new RadioButton("Test box 2")); + rightPanel.Children.Add(new RadioButton { Text = "Disabled", Enabled = false }); + rightPanel.Children.Add(new RadioButton { Text = "Disabled Checked", Enabled = false, Checked = true }); + + leftPanel.Children.Add(info); + + topPanel.Children.Add(leftPanel); + topPanel.Children.Add(rightPanel); + topPanel.Layout = new HorizontalBox(); + + fps = new Label(); + bottomPanel.Children.Add(fps); + + infoLabel = new Label(); + bottomPanel.Children.Add(infoLabel); + + + hideLeftPanel = new Button(); + hideLeftPanel.Text = "Toggle Left Panel Visible"; + hideLeftPanel.Click += (x, y) => { leftPanel.Visible = !leftPanel.Visible; }; + bottomPanel.Children.Add(hideLeftPanel); + + hideRightPanel = new Button(); + hideRightPanel.Text = "Toggle Right Panel Visible"; + hideRightPanel.Click += (x, y) => { rightPanel.Visible = !rightPanel.Visible; }; + bottomPanel.Children.Add(hideRightPanel); + + Window wind = new Window("Transitions"); + wind.SuspendLayout(); + wind.Children.Add(topPanel); + wind.Children.Add(bottomPanel); + wind.AllowDrag = true; + wind.Size = new Size(500, 400); + bottomPanel.LayoutExpand = LayoutExpand.ExpandToMax; + + wind.AcceptButton = (Button)leftPanel.Children[0]; + + GuiRoot.Children.Add(wind); + GuiRoot.ResumeLayout(); + + info.Text = string.Format("L:{0}:{1} R:{2}:{3}", + leftPanel.MinSize.Height, leftPanel.Height, rightPanel.MinSize.Height, rightPanel.Height); + + int totalsize = 0; + foreach (Widget child in rightPanel.Children) + totalsize += child.Height; + + info.Text += " total: " + totalsize.ToString(); + + System.Diagnostics.Debug.Assert( + leftPanel.PointToClient(leftPanel.PointToScreen(new Point(10, 8))) == new Point(10, 8)); + + Display.PackAllSurfaces(); + } + + + void hideMouse_Click(object sender, EventArgs e) + { + if (Mouse.IsHidden) + { + Mouse.Show(); + hideMouse.Text = "Hide Mouse Pointer"; + } + else + { + Mouse.Hide(); + hideMouse.Text = "Show Mouse Pointer"; + } + } + + void vsync_CheckChanged(object sender, EventArgs e) + { + Display.RenderState.WaitForVerticalBlank = !Display.RenderState.WaitForVerticalBlank; + } + + void btn_Click(object sender, EventArgs e) + { + Button btn = sender as Button; + + switch (btn.LayoutExpand) + { + case LayoutExpand.Default: + btn.LayoutExpand = LayoutExpand.ExpandToMax; + break; + + case LayoutExpand.ExpandToMax: + btn.LayoutExpand = LayoutExpand.ShrinkToMin; + break; + + case LayoutExpand.ShrinkToMin: + btn.LayoutExpand = LayoutExpand.Default; + break; + } + } + + #region IAgateTest Members + + public string Name + { + get { return "Transition Tester"; } + } + + public string Category + { + get { return "Gui"; } + } + + #endregion + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-04 05:11:37
|
Revision: 1228 http://agate.svn.sourceforge.net/agate/?rev=1228&view=rev Author: kanato Date: 2010-02-04 05:11:30 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Add documentation. Minor refactoring to improve memory performance. Fix minor bugs in databases. Begin implementation of transition effects in GUI. Modified Paths: -------------- trunk/AgateLib/AgateGame.cs trunk/AgateLib/AgateSetup.cs trunk/AgateLib/AudioLib/ImplementationBase/StreamingSoundBufferImpl.cs trunk/AgateLib/AudioLib/SoundBuffer.cs trunk/AgateLib/AudioLib/SoundFormat.cs trunk/AgateLib/BitmapFont/BitmapFontImpl.cs trunk/AgateLib/BitmapFont/BitmapFontOptions.cs trunk/AgateLib/Core.cs trunk/AgateLib/Data/AgateColumn.cs trunk/AgateLib/Data/AgateColumnDictionary.cs trunk/AgateLib/Data/AgateDatabase.cs trunk/AgateLib/Data/AgateDatabaseException.cs trunk/AgateLib/Data/AgateRow.cs trunk/AgateLib/Data/AgateRowList.cs trunk/AgateLib/Data/AgateTable.cs trunk/AgateLib/Data/AgateTableDictionary.cs trunk/AgateLib/Data/FieldType.cs trunk/AgateLib/DisplayLib/Cache/FontStateCache.cs trunk/AgateLib/DisplayLib/Cache/SurfaceStateCache.cs trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs trunk/AgateLib/DisplayLib/DisplayWindow.cs trunk/AgateLib/DisplayLib/FontState.cs trunk/AgateLib/DisplayLib/FontSurface.cs trunk/AgateLib/DisplayLib/ISurface.cs trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs trunk/AgateLib/DisplayLib/SurfaceState.cs trunk/AgateLib/DisplayLib/TextLayout.cs trunk/AgateLib/DisplayLib/VertexBuffer.cs trunk/AgateLib/Drivers/AgateDriverInfo.cs trunk/AgateLib/Drivers/IUserSetSystems.cs trunk/AgateLib/Drivers/TypeID.cs trunk/AgateLib/Geometry/Matrix4x4.cs trunk/AgateLib/Geometry/Vector2.cs trunk/AgateLib/Geometry/Vector3.cs trunk/AgateLib/Geometry/Vector4.cs trunk/AgateLib/Geometry/VertexTypes/VertexLayout.cs trunk/AgateLib/Gui/Button.cs trunk/AgateLib/Gui/Cache/WidgetCache.cs trunk/AgateLib/Gui/CheckBox.cs trunk/AgateLib/Gui/Container.cs trunk/AgateLib/Gui/GuiRoot.cs trunk/AgateLib/Gui/IGuiThemeEngine.cs trunk/AgateLib/Gui/Layout/BoxLayoutBase.cs trunk/AgateLib/Gui/Layout/Grid.cs trunk/AgateLib/Gui/Layout/VerticalBox.cs trunk/AgateLib/Gui/ListBox.cs trunk/AgateLib/Gui/RadioButton.cs trunk/AgateLib/Gui/ScrollBar.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryButton.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryCheckBox.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryLabel.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryListBox.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryPanel.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScrollBar.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWidget.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryWindow.cs trunk/AgateLib/Gui/Widget.cs trunk/AgateLib/Gui/WidgetList.cs trunk/AgateLib/InputLib/JoystickInput.cs trunk/AgateLib/Particles/ParticleEmitter.cs trunk/AgateLib/Platform.cs trunk/AgateLib/PlatformType.cs trunk/AgateLib/Resources/AgateResourceCollection.cs trunk/AgateLib/Resources/SpriteResource.cs trunk/AgateLib/Serialization/Xle/CompressionType.cs trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs trunk/AgateLib/Settings/SettingsGroup.cs trunk/AgateLib/Sprites/Sprite.cs trunk/AgateLib/Utility/ZipFileProvider.cs trunk/Drivers/AgateDrawing/Drawing_Display.cs trunk/Drivers/AgateDrawing/Drawing_Reporter.cs trunk/Drivers/AgateLib.WinForms/FormsInterop.cs trunk/Drivers/AgateOTK/GL3/GLPrimitiveRenderer.cs trunk/Drivers/AgateOTK/GL3/GLVertexBuffer.cs trunk/Drivers/AgateOTK/GL_Display.cs trunk/Drivers/AgateOTK/Legacy/LegacyPrimitiveRenderer.cs trunk/Drivers/AgateOTK/PrimitiveRenderer.cs trunk/Drivers/AgateSDL/Properties/AssemblyInfo.cs trunk/Drivers/AgateSDX/SDX_Display.cs trunk/Tests/Tests.csproj trunk/Tools/DatabaseEditor/frmImportTable.Designer.cs trunk/Tools/DatabaseEditor/frmImportTable.cs Modified: trunk/AgateLib/AgateGame.cs =================================================================== --- trunk/AgateLib/AgateGame.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/AgateGame.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -244,7 +244,6 @@ /// Override this method to provide a custom splash screen. This method /// is called before the Initialize method is called. /// </summary> - /// <param name="time_ms"></param> protected virtual void RenderSplashScreen() { Display.Clear(Color.White); @@ -306,7 +305,13 @@ } + /// <summary> + /// Gets the initial size of the window. + /// </summary> protected virtual Size WindowSize { get { return new Size(800, 600); } } + /// <summary> + /// Gets whether or not the initial window should be created full screen. + /// </summary> protected virtual bool FullScreen { get { return false; } } #endregion @@ -320,6 +325,9 @@ get { return mWindow; } } + /// <summary> + /// Gets or sets the GuiRoot object. + /// </summary> public Gui.GuiRoot GuiRoot { get { return mGui; } Modified: trunk/AgateLib/AgateSetup.cs =================================================================== --- trunk/AgateLib/AgateSetup.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/AgateSetup.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -77,16 +77,25 @@ private string mCompanyName; private string mAppName; + /// <summary> + /// Indicates the display id that is preferred by the user or application. + /// </summary> public DisplayTypeID PreferredDisplay { get { return mPreferredDisplay; } set { mPreferredDisplay = value; } } + /// <summary> + /// Indicates the audio id that is preferred by the user or application. + /// </summary> public AudioTypeID PreferredAudio { get { return mPreferredAudio; } set { mPreferredAudio = value; } } + /// <summary> + /// Indicates the input id that is preferred by the user or application. + /// </summary> public InputTypeID PreferredInput { get { return mPreferredInput; } @@ -173,7 +182,13 @@ } } + /// <summary> + /// Gets or sets the company name. + /// </summary> public string CompanyName { get { return mCompanyName; } set { mCompanyName = value; } } + /// <summary> + /// Gets or sets the application name. + /// </summary> public string ApplicationName { get { return mAppName; } set { mAppName = value; } } /// <summary> Modified: trunk/AgateLib/AudioLib/ImplementationBase/StreamingSoundBufferImpl.cs =================================================================== --- trunk/AgateLib/AudioLib/ImplementationBase/StreamingSoundBufferImpl.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/AudioLib/ImplementationBase/StreamingSoundBufferImpl.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -24,6 +24,9 @@ namespace AgateLib.AudioLib.ImplementationBase { + /// <summary> + /// Base class for a StreamingSoundBuffer implementation. + /// </summary> public abstract class StreamingSoundBufferImpl { /// <summary> Modified: trunk/AgateLib/AudioLib/SoundBuffer.cs =================================================================== --- trunk/AgateLib/AudioLib/SoundBuffer.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/AudioLib/SoundBuffer.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -143,6 +143,10 @@ return sb; } + /// <summary> + /// Gets or sets a boolean value indicating whether or not the sound buffer + /// should loop when it reaches the end. + /// </summary> public bool Loop { get { return impl.Loop; } Modified: trunk/AgateLib/AudioLib/SoundFormat.cs =================================================================== --- trunk/AgateLib/AudioLib/SoundFormat.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/AudioLib/SoundFormat.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -24,10 +24,13 @@ namespace AgateLib.AudioLib { /// <summary> - /// Class describing what format the raw audio data is in. + /// Class describing what format the streamed raw audio data is in. /// </summary> public class SoundFormat { + /// <summary> + /// Constructs a SoundFormat object. + /// </summary> public SoundFormat() { BitsPerSample = 16; @@ -35,8 +38,18 @@ SamplingFrequency = 44100; } + /// <summary> + /// The number of bits per sample. + /// </summary> public int BitsPerSample { get; set; } + /// <summary> + /// The number of channels in the stream. Samples for individual channels should be + /// sequential and in order. + /// </summary> public int Channels { get; set; } + /// <summary> + /// The frequency in Hz of the audio stream. + /// </summary> public int SamplingFrequency { get; set; } /// <summary> Modified: trunk/AgateLib/BitmapFont/BitmapFontImpl.cs =================================================================== --- trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -182,6 +182,13 @@ mAverageCharWidth = total / (double)count; } + /// <summary> + /// Measures the string based on how it would be drawn with the + /// specified FontState object. + /// </summary> + /// <param name="state"></param> + /// <param name="text"></param> + /// <returns></returns> public override Size MeasureString(FontState state, string text) { if (string.IsNullOrEmpty(text)) Modified: trunk/AgateLib/BitmapFont/BitmapFontOptions.cs =================================================================== --- trunk/AgateLib/BitmapFont/BitmapFontOptions.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/BitmapFont/BitmapFontOptions.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -81,6 +81,10 @@ } } + /// <summary> + /// Returns a string representation of the CharacterRange object. + /// </summary> + /// <returns></returns> public override string ToString() { return ((int)mStartChar).ToString() + " - " + ((int)mEndChar).ToString(); Modified: trunk/AgateLib/Core.cs =================================================================== --- trunk/AgateLib/Core.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Core.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -99,6 +99,9 @@ private static CrossPlatformDebugLevel mCrossPlatform = CrossPlatformDebugLevel.Comment; private static System.Diagnostics.Stopwatch mTime = Stopwatch.StartNew(); + /// <summary> + /// Static class which is used to handle all error reports. + /// </summary> public static class ErrorReporting { private static string mErrorFile = "errorlog.txt"; Modified: trunk/AgateLib/Data/AgateColumn.cs =================================================================== --- trunk/AgateLib/Data/AgateColumn.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateColumn.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -7,6 +7,9 @@ namespace AgateLib.Data { + /// <summary> + /// Represents a column in a table. + /// </summary> public class AgateColumn : IXleSerializable { private string mName; @@ -20,6 +23,10 @@ #region --- Construction and Serialization --- + /// <summary> + /// Creates a deep copy of the AgateColumn object. + /// </summary> + /// <returns></returns> public AgateColumn Clone() { AgateColumn retval = new AgateColumn(); @@ -73,11 +80,19 @@ #endregion #region --- Properties --- + /// <summary> + /// Gets the next value that will be used if this is an + /// auto increment field. If this is not an autoincrement + /// field, the return value is undefined and meaningless. + /// </summary> [Browsable(false)] public int NextAutoIncrementValue { get { return mNextAutoIncrementValue; } } + /// <summary> + /// Gets the width of the column as displayed in the database editor. + /// </summary> [Browsable(false)] public int ColumnWidth { @@ -91,6 +106,9 @@ [Browsable(false)] public int DisplayIndex { get; set; } + /// <summary> + /// Gets the default value for the datatype in this column. + /// </summary> public string DefaultValue { get @@ -102,6 +120,9 @@ } } + /// <summary> + /// Gets the name of the column. + /// </summary> public string Name { get { return mName; } @@ -112,11 +133,20 @@ mName = value; } } + + /// <summary> + /// Gets the data type for value in this column. + /// </summary> public FieldType FieldType { get { return mFieldType; } set { mFieldType = value; } } + + /// <summary> + /// Gets the actual Type object that corresponds to the + /// FieldType enum. + /// </summary> [Browsable(false)] public Type FieldTypeDataType { @@ -125,27 +155,44 @@ return AgateDataHelper.FromFieldType(FieldType); } } + /// <summary> + /// Gets or sets whether or not this column is the primary key. + /// </summary> public bool PrimaryKey { get { return mPrimaryKey; } set { mPrimaryKey = value; } } + /// <summary> + /// Gets or sets whether values entered in this column should be looked + /// up in another table. + /// </summary> public string TableLookup { get { return mTableLookup; } set { mTableLookup = value; } } + /// <summary> + /// Gets or sets what field is used to display data in another table + /// when the table lookup is used. + /// </summary> public string TableDisplayField { get { return mLookupField; } set { mLookupField = value; } } + /// <summary> + /// Gets or sets the description of this column. This property is also used + /// to comment properties when code is autogenerated. + /// </summary> public string Description { get { return mDescription; } set { mDescription = value; } } - + /// <summary> + /// Gets whether or not the data type for this column is a numeric type. + /// </summary> public bool IsNumeric { get @@ -171,6 +218,10 @@ } #endregion + /// <summary> + /// Returns a string representation of the AgateColumn object. + /// </summary> + /// <returns></returns> public override string ToString() { return "Column: " + Name; @@ -185,6 +236,11 @@ "Invalid name \"{0}\" supplied. Column name should be a valid C# or VB identifier.", value)); } + /// <summary> + /// Checks to see if the name is a valid for a column. It must be a valid C# identifier. + /// </summary> + /// <param name="value"></param> + /// <returns></returns> public static bool IsValidColumnName(string value) { return AgateDataHelper.IsValidIdentifier(value); Modified: trunk/AgateLib/Data/AgateColumnDictionary.cs =================================================================== --- trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -6,6 +6,9 @@ namespace AgateLib.Data { + /// <summary> + /// Container class for columns in an AgateTable object. + /// </summary> public class AgateColumnDictionary : IEnumerable<AgateColumn> { AgateTable mParentTable; @@ -27,6 +30,11 @@ set { mParentTable = value; } } + /// <summary> + /// Gets a column by the specified name. + /// </summary> + /// <param name="name">Name of the column to get.</param> + /// <returns></returns> public AgateColumn this[string name] { get @@ -39,6 +47,11 @@ return result; } } + /// <summary> + /// Gets a column by its numerical index. + /// </summary> + /// <param name="index">Index of the column to get.</param> + /// <returns></returns> public AgateColumn this[int index] { get { return mColumns[index]; } @@ -69,6 +82,10 @@ mColumns.Insert(newIndex, col); } + /// <summary> + /// Returns a string representation of the AgateColumnDictionary object. + /// </summary> + /// <returns></returns> public override string ToString() { return "Columns: " + mColumns.Count; @@ -79,11 +96,18 @@ get { return mColumns; } } + /// <summary> + /// Returns the number of columns in the AgateColumnDictionary. + /// </summary> public int Count { get { return mColumns.Count; } } + /// <summary> + /// Gets the column which acts as the primary key for the table. + /// If no column is marked as the primary key, null is returned. + /// </summary> public AgateColumn PrimaryKeyColumn { get @@ -97,15 +121,19 @@ mColumns.RemoveAt(index); } - #region IEnumerable<AgateColumn> Members + #region --- IEnumerable<AgateColumn> Members --- + /// <summary> + /// Enumerates the columns. + /// </summary> + /// <returns></returns> public IEnumerator<AgateColumn> GetEnumerator() { return mColumns.GetEnumerator(); } #endregion - #region IEnumerable Members + #region --- IEnumerable Members --- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { @@ -115,7 +143,9 @@ #endregion - + /// <summary> + /// Sorts the columns by their display index. + /// </summary> public void SortByDisplayIndex() { mColumns.Sort((x, y) => x.DisplayIndex.CompareTo(y.DisplayIndex)); Modified: trunk/AgateLib/Data/AgateDatabase.cs =================================================================== --- trunk/AgateLib/Data/AgateDatabase.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateDatabase.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -24,10 +24,18 @@ { private AgateTableDictionary mTables; + /// <summary> + /// Constructs a new AgateDatabase object. + /// </summary> public AgateDatabase() { mTables = new AgateTableDictionary(this); } + /// <summary> + /// Loads an AgateDatabase object from a file on disk. + /// </summary> + /// <param name="filename"></param> + /// <returns></returns> public static AgateDatabase FromFile(string filename) { AgateDatabase db = ReadDatabase(new AgateLib.Utility.ZipFileProvider(filename)); @@ -35,17 +43,24 @@ return db; } + /// <summary> + /// Loads an AgateDatabase object from the specified file provider. + /// </summary> + /// <param name="provider"></param> + /// <returns></returns> public static AgateDatabase FromProvider(IFileProvider provider) { return ReadDatabase(provider); } + /// <summary> + /// Destroys an AgateDatabase object. + /// </summary> public void Dispose() { ((IDisposable)mTables).Dispose(); } - private static AgateDatabase ReadDatabase(IFileProvider provider) { XleSerializer ser = new XleSerializer(typeof(AgateDatabase)); @@ -60,7 +75,6 @@ } } - #region IXleSerializable Members void IXleSerializable.WriteData(XleSerializationInfo info) @@ -88,6 +102,10 @@ #endregion + /// <summary> + /// Gets or sets the namespace that is used when code is generated + /// from the AgateDatabase. + /// </summary> public string CodeNamespace { get; set; } private IEnumerable<string> TableList @@ -118,6 +136,10 @@ get { return mTables; } } + /// <summary> + /// Gets the text that goes into catalog.txt in the database archive. + /// </summary> + /// <returns></returns> public string CatalogString() { StringBuilder b = new StringBuilder(); Modified: trunk/AgateLib/Data/AgateDatabaseException.cs =================================================================== --- trunk/AgateLib/Data/AgateDatabaseException.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateDatabaseException.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -5,6 +5,9 @@ namespace AgateLib.Data { + /// <summary> + /// Exception which is thrown if there is an error when working with the database. + /// </summary> [global::System.Serializable] public class AgateDatabaseException : AgateException { @@ -15,12 +18,42 @@ // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp // - public AgateDatabaseException() { ErrorCount = 1; } - public AgateDatabaseException(string message) : base(message) { ErrorCount = 1; } - public AgateDatabaseException(string message, Exception inner) : base(message, inner) { ErrorCount = 1; } + /// <summary> + /// Constructs a database exception. + /// </summary> + public AgateDatabaseException() + { + ErrorCount = 1; + } + /// <summary> + /// Constructs a database exception. + /// </summary> + /// <param name="message"></param> + public AgateDatabaseException(string message) + : base(message) + { + ErrorCount = 1; + } + /// <summary> + /// Constructs a database exception. + /// </summary> + /// <param name="message"></param> + /// <param name="inner"></param> + public AgateDatabaseException(string message, Exception inner) + : base(message, inner) + { + ErrorCount = 1; + } + /// <summary> + /// Constructs a database exception. + /// </summary> + /// <param name="format"></param> + /// <param name="args"></param> public AgateDatabaseException(string format, params object[] args) : base(format, args) - { ErrorCount = 1; } + { + ErrorCount = 1; + } internal AgateDatabaseException(int errorCount, string message) : base(message) { @@ -32,6 +65,11 @@ ErrorCount = errorCount; } + /// <summary> + /// Constructs a database exception. + /// </summary> + /// <param name="info"></param> + /// <param name="context"></param> protected AgateDatabaseException( System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) Modified: trunk/AgateLib/Data/AgateRow.cs =================================================================== --- trunk/AgateLib/Data/AgateRow.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateRow.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -5,11 +5,22 @@ namespace AgateLib.Data { + /// <summary> + /// Class which contains a row of data in a table of an AgateDatabase object. + /// Data added to this class is validated against the data types for the columns + /// in the table. + /// </summary> public class AgateRow { Dictionary<string, string> mValues = new Dictionary<string, string>(); AgateTable mParentTable; + /// <summary> + /// Constructs a new AgateRow object representing a single instance + /// of the data. + /// </summary> + /// <param name="parentTable">The table into which the row will be added. + /// This is required to validate data that gets added to the row.</param> public AgateRow(AgateTable parentTable) { this.mParentTable = parentTable; @@ -20,6 +31,10 @@ } } + /// <summary> + /// Creates a deep copy of the AgateRow object. + /// </summary> + /// <returns></returns> public AgateRow Clone() { AgateRow retval = new AgateRow(mParentTable); @@ -29,6 +44,9 @@ return retval; } + /// <summary> + /// Gets the AgateTable object that this row belongs to or will be added to. + /// </summary> public AgateTable ParentTable { get { return mParentTable; } @@ -44,9 +62,9 @@ } /// <summary> - /// Shortcut for this[column.Name]. + /// Gets or sets the field value for this row for the specified column. /// </summary> - /// <param name="column"></param> + /// <param name="column">The column which indexes the data.</param> /// <returns></returns> public string this[AgateColumn column] { @@ -70,14 +88,19 @@ } } } - public string this[string key] + /// <summary> + /// Gets or sets the field value for this row for the specified column. + /// </summary> + /// <param name="column">The name of the column which indexes the data.</param> + /// <returns></returns> + public string this[string column] { - get { return mValues[key]; } + get { return mValues[column]; } set { - this[mParentTable.Columns[key]] = value; + this[mParentTable.Columns[column]] = value; - mValues[key] = value; + mValues[column] = value; } } @@ -86,6 +109,10 @@ mValues[column.Name] = value; } + /// <summary> + /// Gets a string representation of the row. + /// </summary> + /// <returns></returns> public override string ToString() { StringBuilder b = new StringBuilder(); Modified: trunk/AgateLib/Data/AgateRowList.cs =================================================================== --- trunk/AgateLib/Data/AgateRowList.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateRowList.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -6,7 +6,10 @@ namespace AgateLib.Data { - public class AgateRowList : IList<AgateRow> + /// <summary> + /// Container class for AgateRow objects in a table. + /// </summary> + public class AgateRowList : IList<AgateRow> { AgateTable mParentTable; List<AgateRow> mRows = new List<AgateRow>(); @@ -28,11 +31,19 @@ set { mParentTable = value; } } - + /// <summary> + /// Performs the specified action for each row in the list. + /// </summary> + /// <param name="action">The System.Action<T> delegate to perform on + /// each row.</param> public void ForEach(Action<AgateRow> action) { mRows.ForEach(action); } + /// <summary> + /// Sorts rows in descending order for the specified column. + /// </summary> + /// <param name="col">The column whose data is to be sorted on.</param> public void SortDescending(AgateColumn col) { if (col.IsNumeric) @@ -44,6 +55,10 @@ mRows.Sort((x, y) => -x[col].CompareTo(y[col])); } } + /// <summary> + /// Sorts rows in ascending order for the specified column. + /// </summary> + /// <param name="col">The column whose data is to be sorted on.</param> public void SortAscending(AgateColumn col) { if (col.IsNumeric) @@ -56,18 +71,31 @@ } } + /// <summary> + /// Returns a string representation of the AgateRowList object. + /// </summary> + /// <returns></returns> public override string ToString() { return "Rows: " + mRows.Count; } - #region IList<AgateRow> Members + #region --- IList<AgateRow> Members --- + /// <summary> + /// Gets the index of the specified row. + /// </summary> + /// <param name="item"></param> + /// <returns></returns> public int IndexOf(AgateRow item) { return mRows.IndexOf(item); } - + /// <summary> + /// Inserts a new row into the table. + /// </summary> + /// <param name="index"></param> + /// <param name="item"></param> public void Insert(int index, AgateRow item) { item.ValidateData(mParentTable); @@ -75,19 +103,25 @@ mRows.Insert(index, item); } - + /// <summary> + /// Removes a row by its index. + /// </summary> + /// <param name="index"></param> public void RemoveAt(int index) { this[index].ParentTable = null; mRows.RemoveAt(index); } - + /// <summary> + /// Gets or sets a row by its index. + /// The data in the row is validated when setting. An exception + /// is thrown if the data validation fails. + /// </summary> + /// <param name="index">Index of the row.</param> + /// <returns></returns> public AgateRow this[int index] { - get - { - return mRows[index]; - } + get { return mRows[index]; } set { AgateRow old = mRows[index]; @@ -110,8 +144,12 @@ #endregion - #region ICollection<AgateRow> Members + #region --- ICollection<AgateRow> Members --- + /// <summary> + /// Adds a row to the AgateRowList. + /// </summary> + /// <param name="row"></param> public void Add(AgateRow row) { if (row == null) @@ -122,50 +160,66 @@ mRows.Add(row); } - + /// <summary> + /// Removes all the rows. + /// </summary> public void Clear() { mRows.Clear(); } - + /// <summary> + /// Returns true if the specified row is in the table. + /// </summary> + /// <param name="item"></param> + /// <returns></returns> public bool Contains(AgateRow item) { return mRows.Contains(item); } - public void CopyTo(AgateRow[] array, int arrayIndex) + void ICollection<AgateRow>.CopyTo(AgateRow[] array, int arrayIndex) { mRows.CopyTo(array, arrayIndex); } + /// <summary> + /// Gets the number of rows in the table. + /// </summary> public int Count { get { return mRows.Count; } } - public bool IsReadOnly + bool ICollection<AgateRow>.IsReadOnly { get { return false; } } + /// <summary> + /// Removes a row from the table. + /// </summary> + /// <param name="item"></param> + /// <returns></returns> public bool Remove(AgateRow item) { return mRows.Remove(item); } #endregion + #region --- IEnumerable<AgateRow> Members --- - #region IEnumerable<AgateRow> Members - + /// <summary> + /// Enumerates the rows. + /// </summary> + /// <returns></returns> public IEnumerator<AgateRow> GetEnumerator() { return mRows.GetEnumerator(); } #endregion + #region --- IEnumerable Members --- - #region IEnumerable Members - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); Modified: trunk/AgateLib/Data/AgateTable.cs =================================================================== --- trunk/AgateLib/Data/AgateTable.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateTable.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -7,6 +7,9 @@ namespace AgateLib.Data { + /// <summary> + /// Class which represents a table in a database. + /// </summary> public class AgateTable : IXleSerializable { string mName; @@ -15,13 +18,19 @@ #region --- Construction and Serialization --- + /// <summary> + /// Constructs an AgateTable object. + /// </summary> public AgateTable() { mColumns = new AgateColumnDictionary(this); mRows = new AgateRowList(this); } - + /// <summary> + /// Creates a deep copy of an AgateTable object. + /// </summary> + /// <returns></returns> public AgateTable Clone() { XleSerializer ser = new XleSerializer(typeof(AgateTable)); @@ -51,7 +60,6 @@ info.Write("Columns", mColumns.ColumnList); info.Write("Rows", RowString()); } - void IXleSerializable.ReadData(XleSerializationInfo info) { mName = info.ReadString("Name"); @@ -115,6 +123,11 @@ #endregion + /// <summary> + /// Gets or sets the name of the table. This must be a valid + /// C# identifier, so it must start with a letter or underscore + /// and can contain only letters, numbers or underscores. + /// </summary> public string Name { get { return mName; } @@ -134,15 +147,26 @@ throw new ArgumentException("Invalid name. Table name should be a valid C# or VB identifier."); } + /// <summary> + /// Returns true if the specified string is valid as a table name. + /// </summary> + /// <param name="value"></param> + /// <returns></returns> public static bool IsValidTableName(string value) { return AgateDataHelper.IsValidIdentifier(value); } + /// <summary> + /// Gets the list of columns in the table. + /// </summary> public AgateColumnDictionary Columns { get { return mColumns; } } + /// <summary> + /// Gets the list of rows in the table. + /// </summary> public AgateRowList Rows { get { return mRows; } @@ -155,6 +179,10 @@ row.ValidateData(this); } + /// <summary> + /// Adds a column to the table. + /// </summary> + /// <param name="col"></param> public void AddColumn(AgateColumn col) { mColumns.Add(col); @@ -165,7 +193,10 @@ } mRows.ForEach(x => x.ValidateData(this)); } - + /// <summary> + /// Removes a column from the table. + /// </summary> + /// <param name="index"></param> public void RemoveColumn(int index) { string text = mColumns[index].Name; @@ -177,7 +208,11 @@ mColumns.Remove(index); } - + /// <summary> + /// Overwrites a column in the table. + /// </summary> + /// <param name="index"></param> + /// <param name="newColumn"></param> public void OverwriteColumn(int index, AgateColumn newColumn) { AgateColumn old = Columns[index]; @@ -196,7 +231,7 @@ { Validate(); - if (newColumn.FieldType == FieldType.AutoNumber) + if (newColumn.FieldType == FieldType.AutoNumber && Rows.Count > 0) { int max = Rows.Max(x => int.Parse(x[newColumn])); @@ -216,8 +251,11 @@ } } - - + /// <summary> + /// Moves a column in the table to a new index. + /// </summary> + /// <param name="oldIndex"></param> + /// <param name="newIndex"></param> public void MoveColumn(int oldIndex, int newIndex) { AgateColumn col = mColumns[oldIndex]; Modified: trunk/AgateLib/Data/AgateTableDictionary.cs =================================================================== --- trunk/AgateLib/Data/AgateTableDictionary.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/AgateTableDictionary.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -6,7 +6,10 @@ namespace AgateLib.Data { - public class AgateTableDictionary : ICollection<AgateTable>, IDisposable + /// <summary> + /// Class which contains all the tables in the database. + /// </summary> + public class AgateTableDictionary : ICollection<AgateTable>, IDisposable { List<AgateTable> mTables = new List<AgateTable>(); AgateDatabase mParentDatabase; @@ -39,6 +42,11 @@ internal IFileProvider FileProvider { get; set; } internal bool OwnFileProvider { get; set; } + /// <summary> + /// Gets a table in the database. + /// </summary> + /// <param name="name">The name of the table to load. This is case-insensitive.</param> + /// <returns></returns> public AgateTable this[string name] { get @@ -52,7 +60,7 @@ mUnloadedTables.Remove(name); } - var result = mTables.First(x => x.Name == name); + var result = mTables.First(x => string.Compare(x.Name, name, true) == 0); if (result == null) { @@ -67,6 +75,12 @@ return result; } } + /// <summary> + /// Gets a table by its index in the database. + /// </summary> + /// <param name="index">Numerical index of the table. Should be between + /// 0 and Count-1.</param> + /// <returns></returns> public AgateTable this[int index] { get { return mTables[index]; } @@ -95,13 +109,18 @@ mUnloadedTables.Clear(); } - + /// <summary> + /// Adds a table to the database. The name of the added table + /// must not conflict with a table already in the database. + /// Table names are case-insensitive. + /// </summary> + /// <param name="tbl">The table to add.</param> public void Add(AgateTable tbl) { if (tbl == null) throw new ArgumentNullException("tbl", "Passed table cannot be null."); - if (mTables.Any(x => x.Name == tbl.Name)) + if (mTables.Any(x => 0 == string.Compare(x.Name, tbl.Name, true))) throw new ArgumentException("Table " + tbl.Name + " already exists."); mTables.Add(tbl); @@ -115,11 +134,21 @@ { mUnloadedTables.AddRange(tables); } + /// <summary> + /// Constructs a string representation of the table dictionary. + /// </summary> + /// <returns></returns> public override string ToString() { return "Tables: " + mTables.Count; } + /// <summary> + /// Returns true if there is a table of the specified name in the database. + /// Table names are case-insensitive. + /// </summary> + /// <param name="name">The name of the table to search for.</param> + /// <returns></returns> public bool ContainsTable(string name) { if (mUnloadedTables.Any(x => string.Compare(x, name, true) == 0)) @@ -133,8 +162,12 @@ - #region IEnumerable<Table> Members + #region --- IEnumerable<Table> Members --- + /// <summary> + /// Enumerates the tables. + /// </summary> + /// <returns></returns> public IEnumerator<AgateTable> GetEnumerator() { LoadAllTables(); @@ -143,44 +176,56 @@ } #endregion + #region --- IEnumerable Members --- - #region IEnumerable Members - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); } #endregion + #region --- ICollection<AgateTable> Members --- - #region ICollection<AgateTable> Members - - + /// <summary> + /// Removes all the tables. + /// </summary> public void Clear() { mTables.Clear(); } + /// <summary> + /// Returns true if the specified table is in the database. + /// </summary> + /// <param name="item"></param> + /// <returns></returns> public bool Contains(AgateTable item) { return mTables.Contains(item); } - public void CopyTo(AgateTable[] array, int arrayIndex) + void ICollection<AgateTable>.CopyTo(AgateTable[] array, int arrayIndex) { mTables.CopyTo(array, arrayIndex); } - + /// <summary> + /// Returns the number of tables in the database. + /// </summary> public int Count { get { return mTables.Count; } } - public bool IsReadOnly + bool ICollection<AgateTable>.IsReadOnly { get { return false; } } + /// <summary> + /// Removes the specified table from the database. + /// </summary> + /// <param name="table"></param> + /// <returns></returns> public bool Remove(AgateTable table) { return mTables.Remove(table); Modified: trunk/AgateLib/Data/FieldType.cs =================================================================== --- trunk/AgateLib/Data/FieldType.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/Data/FieldType.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -5,36 +5,96 @@ namespace AgateLib.Data { + /// <summary> + /// Enum which is used to indicate the type of data + /// that a field in an AgateDatabase should contain. + /// </summary> public enum FieldType { + /// <summary> + /// The field contains string data. + /// </summary> [DataType(typeof(String))] String, + + /// <summary> + /// The field contains a logical true/false value. + /// </summary> [DataType(typeof(Boolean))] Boolean, + + /// <summary> + /// The field contains a 16-bit integer. + /// </summary> [DataType(typeof(Int16))] Int16, + + /// <summary> + /// The field contains a 32-bit integer. + /// </summary> [DataType(typeof(Int32))] Int32, + + /// <summary> + /// The field contains an unsigned 16-bit integer. + /// </summary> [DataType(typeof(UInt16))] UInt16, + + /// <summary> + /// The field contains an unsigned 32-bit integer. + /// </summary> [DataType(typeof(UInt32))] UInt32, + + /// <summary> + /// The field contains an unsigned 8-bit integer. + /// </summary> [DataType(typeof(Byte))] Byte, + + /// <summary> + /// The field contains a signed 8-bit integer. + /// </summary> [DataType(typeof(SByte))] SByte, + + + /// <summary> + /// The field contains a single precision floating point value. + /// </summary> [DataType(typeof(Single))] Single, + /// <summary> + /// The field contains a double precision floating point value. + /// </summary> [DataType(typeof(Double))] Double, + + /// <summary> + /// The field contains the .NET System.Decimal type. + /// </summary> [DataType(typeof(Decimal))] Decimal, + + /// <summary> + /// The field contains a DateTime structure. + /// </summary> [DataType(typeof(DateTime))] DateTime, + + /// <summary> + /// The field is automatically numbered as rows are added. + /// This implies a 32-bit integer is used. + /// </summary> [DataType(typeof(Int32))] AutoNumber, } + /// <summary> + /// Class which is used for the FieldType enum in order to + /// associate actual type objects with the enum values. + /// </summary> [global::System.AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = true)] sealed class DataTypeAttribute : Attribute { Modified: trunk/AgateLib/DisplayLib/Cache/FontStateCache.cs =================================================================== --- trunk/AgateLib/DisplayLib/Cache/FontStateCache.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Cache/FontStateCache.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -23,22 +23,49 @@ namespace AgateLib.DisplayLib.Cache { + /// <summary> + /// Base class for cache objects used for FontState. + /// </summary> public abstract class FontStateCache { + /// <summary> + /// Performs a deep clone of the FontStateCache-derived object. + /// </summary> + /// <returns></returns> protected internal abstract FontStateCache Clone(); - + + /// <summary> + /// Function called when the text is changed. + /// </summary> + /// <param name="fontState"></param> protected internal virtual void OnTextChanged(FontState fontState) { } + /// <summary> + /// Function called when the location of text is changed. + /// </summary> + /// <param name="fontState"></param> protected internal virtual void OnLocationChanged(FontState fontState) { } + /// <summary> + /// Function called when the display alignment of the text is changed. + /// </summary> + /// <param name="fontState"></param> protected internal virtual void OnDisplayAlignmentChanged(FontState fontState) { } + /// <summary> + /// Function called when the color of the text is changed. + /// </summary> + /// <param name="fontState"></param> protected internal virtual void OnColorChanged(FontState fontState) { } + /// <summary> + /// Function called when the scale of the text is changed. + /// </summary> + /// <param name="fontState"></param> protected internal virtual void OnScaleChanged(FontState fontState) { } Modified: trunk/AgateLib/DisplayLib/Cache/SurfaceStateCache.cs =================================================================== --- trunk/AgateLib/DisplayLib/Cache/SurfaceStateCache.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Cache/SurfaceStateCache.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -23,6 +23,9 @@ namespace AgateLib.DisplayLib.Cache { + /// <summary> + /// Base class for a cache object used to cache calculated values for a particular SurfaceState object. + /// </summary> public abstract class SurfaceStateCache { } Modified: trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs =================================================================== --- trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -106,16 +106,28 @@ get { return Display.Impl.CapsBool(DisplayBoolCaps.CanCreateBitmapFont); } } + /// <summary> + /// Gets the maximum size a surface can be. + /// </summary> public Size MaxSurfaceSize { get { return Display.Impl.CapsSize(DisplaySizeCaps.MaxSurfaceSize); } } } + /// <summary> + /// Enum which is used to specify a Caps value which should return a Size object. + /// </summary> public enum DisplaySizeCaps { + /// <summary> + /// Value for getting the maximum supported surface size. + /// </summary> MaxSurfaceSize, } + /// <summary> + /// Enum which is used to specify a Caps value which should return a logical value. + /// </summary> public enum DisplayBoolCaps { /// <summary> Modified: trunk/AgateLib/DisplayLib/DisplayWindow.cs =================================================================== --- trunk/AgateLib/DisplayLib/DisplayWindow.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/DisplayWindow.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -172,6 +172,9 @@ #endregion + /// <summary> + /// Gets the FrameBuffer object which represents the memory to draw to. + /// </summary> public FrameBuffer FrameBuffer { get @@ -185,7 +188,12 @@ } } - [Obsolete] + /// <summary> + /// Compatibility conversion. Read from the FrameBuffer property instead. + /// </summary> + /// <param name="wind"></param> + /// <returns></returns> + [Obsolete("Read from wind.FrameBuffer instead.")] public static implicit operator FrameBuffer(DisplayWindow wind) { return wind.FrameBuffer; @@ -326,6 +334,9 @@ impl.SetFullScreen(width, height, bpp); } + /// <summary> + /// Creates an orthogonal projection matrix that maps drawing units onto pixels. + /// </summary> public Matrix4x4 OrthoProjection { get { return Matrix4x4.Ortho(new RectangleF(0, 0, Width, Height), -1, 1); } Modified: trunk/AgateLib/DisplayLib/FontState.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontState.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/FontState.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -25,6 +25,9 @@ namespace AgateLib.DisplayLib { + /// <summary> + /// Class which represents the state information used to draw texdt on the screen. + /// </summary> public class FontState : ICloneable { private OriginAlignment mAlignment = OriginAlignment.TopLeft; @@ -51,6 +54,9 @@ Cache.OnTextChanged(this); } } + /// <summary> + /// Gets the text which was transformed by the string transformer. + /// </summary> public string TransformedText { get { return mTransformedText; } @@ -158,6 +164,10 @@ #region --- ICloneable Members --- + /// <summary> + /// Returns a deep copy of the FontState object. + /// </summary> + /// <returns></returns> public FontState Clone() { FontState retval = new FontState(); Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -340,7 +340,6 @@ /// Measures the display size of the specified string. /// </summary> /// <param name="text"></param> - /// <param name="length"></param> /// <returns></returns> public Size MeasureString(string text) { @@ -349,8 +348,8 @@ /// <summary> /// Measures the display size of the specified string. /// </summary> + /// <param name="state"></param> /// <param name="text"></param> - /// <param name="length"></param> /// <returns></returns> public Size MeasureString(FontState state, string text) { Modified: trunk/AgateLib/DisplayLib/ISurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/ISurface.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/ISurface.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -135,8 +135,15 @@ /// </summary> int SurfaceWidth { get; } + /// <summary> + /// Gets the SurfaceState object which is used to handle drawing. + /// </summary> SurfaceState State { get; } + /// <summary> + /// Draws the surface using the specified state object. + /// </summary> + /// <param name="State"></param> void Draw(SurfaceState State); } } Modified: trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs =================================================================== --- trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -36,12 +36,26 @@ public abstract class DisplayImpl : DriverImplBase { private double mAlphaThreshold = 5.0 / 255.0; + Point[] mEllipsePoints; + PointF[] mEllipsePointfs; private FrameBuffer mRenderTarget; #region --- Capabilities Reporting --- + /// <summary> + /// Gets a caps value which should return a logical value. + /// When implementing this, you should return false for any value + /// which you do not explicitly handle. + /// </summary> + /// <param name="caps"></param> + /// <returns></returns> public abstract bool CapsBool(DisplayBoolCaps caps); + /// <summary> + /// Gets a caps value which should return a Size object. + /// </summary> + /// <param name="displaySizeCaps"></param> + /// <returns></returns> public abstract Size CapsSize(DisplaySizeCaps displaySizeCaps); #endregion @@ -326,6 +340,10 @@ } #endregion + + /// <summary> + /// Obsolete. Use Display.Caps.MaxSurfaceSize instead. + /// </summary> [Obsolete("Use Display.Caps instead.", true)] public virtual Size MaxSurfaceSize { get { return Display.Caps.MaxSurfaceSize; } } @@ -359,6 +377,7 @@ /// <param name="dest"></param> public abstract void Clear(Color color, Rectangle dest); + /// <summary> /// Draws an ellipse by making a bunch of connected lines. /// @@ -383,19 +402,26 @@ // we will take the circumference as being the number of points to draw // on the ellipse. - Point[] pts = new Point[(int)Math.Ceiling(circumference * 2)]; - double step = 2 * Math.PI / (pts.Length - 1); + int ptCount = (int)Math.Ceiling(circumference * 2); + if (mEllipsePoints == null || mEllipsePoints.Length < ptCount) + mEllipsePoints = new Point[ptCount]; - for (int i = 0; i < pts.Length; i++) + double step = 2 * Math.PI / (ptCount - 1); + + for (int i = 0; i < ptCount; i++) { - pts[i] = new Point((int)(center.X + radiusX * Math.Cos(step * i) + 0.5), + mEllipsePoints[i] = new Point((int)(center.X + radiusX * Math.Cos(step * i) + 0.5), (int)(center.Y + radiusY * Math.Sin(step * i) + 0.5)); } - DrawLines(pts, color); + DrawLines(mEllipsePoints, 0, ptCount, color); } - + /// <summary> + /// Draws a solid ellipse. + /// </summary> + /// <param name="rect">The rectangle in which the ellipse should be inscribed.</param> + /// <param name="color">The color of the ellipse.</param> public virtual void FillEllipse(RectangleF rect, Color color) { PointF center = new PointF(rect.Left + rect.Width / 2, @@ -411,21 +437,41 @@ // we will take the circumference as being the number of points to draw // on the ellipse. - PointF[] pts = new PointF[(int)Math.Ceiling(circumference * 2)]; - double step = 2 * Math.PI / (pts.Length - 1); + int ptCount = (int)Math.Ceiling(circumference * 2); + if (mEllipsePointfs == null || mEllipsePointfs.Length < ptCount) + mEllipsePointfs = new PointF[ptCount]; - for (int i = 0; i < pts.Length; i++) + double step = 2 * Math.PI / (ptCount - 1); + + for (int i = 0; i < ptCount; i++) { - pts[i] = new PointF((float)(center.X + radiusX * Math.Cos(step * i) + 0.5), + mEllipsePointfs[i] = new PointF((float)(center.X + radiusX * Math.Cos(step * i) + 0.5), (float)(center.Y + radiusY * Math.Sin(step * i) + 0.5)); } - FillPolygon(pts, color); + FillPolygon(mEllipsePointfs, 0, ptCount, color); } - public abstract void FillPolygon(PointF[] pts, Color color); + /// <summary> + /// Draws a filled polygon of the specified color. + /// </summary> + /// <param name="pts">The array of points which make up the boundary of the polygon.</param> + /// <param name="color">The color to fill the polygon.</param> + public void FillPolygon(PointF[] pts, Color color) + { + FillPolygon(pts, 0, pts.Length, color); + } /// <summary> + /// Draws a filled polygon of the specified color. + /// </summary> + /// <param name="pts">An array containing the points which make up the boundary of the polygon.</param> + /// <param name="startIndex">The index of the first point in the boundary.</param> + /// <param name="length">The number of points to use.</param> + /// <param name="color">The color to fill the polygon.</param> + public abstract void FillPolygon(PointF[] pts, int startIndex, int length, Color color); + + /// <summary> /// Draws a line between the two specified endpoints. /// </summary> /// <param name="a"></param> @@ -447,6 +493,22 @@ DrawLine(pt[i], pt[i + 1], color); } /// <summary> + /// Draws a bunch of connected points. + /// + /// Info for developers: + /// The base class implements this by making several calls to DrawLine. + /// You may want to override this one to minimize state changes. + /// </summary> + /// <param name="pt">An array containing the points to draw.</param> + /// <param name="startIndex">Index of the first point in the array.</param> + /// <param name="length">Number of points to use in the array.</param> + /// <param name="color"></param> + public virtual void DrawLines(Point[] pt, int startIndex, int length, Color color) + { + for (int i = startIndex; i < startIndex + pt.Length - 1; i++) + DrawLine(pt[i], pt[i + 1], color); + } + /// <summary> /// Draws a bunch of unconnected lines. /// <para> /// Info for developers: Modified: trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs =================================================================== --- trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -54,6 +54,10 @@ #region --- Drawing the surface to the screen --- + /// <summary> + /// Draws the surface to the screen using the specified state information. + /// </summary> + /// <param name="state"></param> public abstract void Draw(SurfaceState state); #endregion @@ -70,7 +74,6 @@ /// <summary> /// Creates a new SurfaceImpl object which comes from a small sub-rectangle on this surface. /// </summary> - /// <param name="surface"></param> /// <param name="srcRect"></param> /// <returns></returns> public abstract SurfaceImpl CarveSubSurface(Rectangle srcRect); @@ -121,12 +124,15 @@ } #endregion - - #region --- Surface properties --- private InterpolationMode mInterpolationHint; + /// <summary> + /// Gets or sets the InterpolationMode value, indicating + /// what sampling to use for surfaces. This property may + /// be replaced by something else in the future. + /// </summary> public virtual InterpolationMode InterpolationHint { get { return mInterpolationHint; } Modified: trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -44,8 +44,18 @@ Lighting3D = null; } + /// <summary> + /// Gets an object implementing the Basic2DShader class. + /// This should always be available. + /// </summary> public static Basic2DShader Basic2DShader { get; private set; } + /// <summary> + /// Gets an object implementing the Lighting2D class. + /// </summary> public static Lighting2D Lighting2D { get; private set; } + /// <summary> + /// Gets and object implementing the Lighting3D class. + /// </summary> public static Lighting3D Lighting3D { get; private set; } } Modified: trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -46,6 +46,9 @@ get { return (Basic2DImpl)base.Impl; } } + /// <summary> + /// Gets the BuiltInShaderType enum corresponding to this built in shader. + /// </summary> protected override BuiltInShader BuiltInShaderType { get { return BuiltInShader.Basic2DShader; } Modified: trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -23,12 +23,32 @@ namespace AgateLib.DisplayLib.Shaders { + /// <summary> + /// Exception raised when there is an error with the shader compiler. + /// </summary> [global::System.Serializable] - public class AgateShaderCompilerException : Exception + public class AgateShaderCompilerException : AgateException { + /// <summary> + /// Constructs an AgateShaderCompilerException object. + /// </summary> public AgateShaderCompilerException() { } + /// <summary> + /// Constructs an AgateShaderCompilerException object. + /// </summary> + /// <param name="message"></param> public AgateShaderCompilerException(string message) : base(message) { } + /// <summary> + /// Constructs an AgateShaderCompilerException object. + /// </summary> + /// <param name="inner"></param> + /// <param name="message"></param> public AgateShaderCompilerException(string message, Exception inner) : base(message, inner) { } + /// <summary> + /// Constructs an AgateShaderCompilerException object. + /// </summary> + /// <param name="context"></param> + /// <param name="info"></param> protected AgateShaderCompilerException( System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) Modified: trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -24,6 +24,9 @@ namespace AgateLib.DisplayLib.Shaders.Implementation { + /// <summary> + /// Base class for implementing an AgateShader object. + /// </summary> public abstract class AgateShaderImpl { public abstract void SetTexture(EffectTexture tex, string variableName); Modified: trunk/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -24,8 +24,14 @@ namespace AgateLib.DisplayLib.Shaders.Implementation { + /// <summary> + /// Base class for the implementation of the Basic2D shader. + /// </summary> public abstract class Basic2DImpl : AgateShaderImpl { + /// <summary> + /// Gets or sets the coordinate system used (orthogonal projection). + /// </summary> public abstract Rectangle CoordinateSystem { get; set; } } } Modified: trunk/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs 2010-02-01 18:15:54 UTC (rev 1227) +++ trunk/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs 2010-02-04 05:11:30 UTC (rev 1228) @@ -23,10 +23,24 @@ namespace AgateLib.DisplayLib.Shaders.Implementation { + /// <summary> + /// Enum indicating shaders which should be built into AgateLib drivers. + /// </summary> public enum BuiltInShader { + /// <summary> + /// This is the simplest 2D shader implemented. It must be supported + /// by all drivers. + /// </summary> Basic2DShader, + /// <summary> + /// This is a slightly enhanced 2D shader, which includes lighting calculations. + /// </summary> Lighting2D, + /// <summary> + /// This is a basic 3D shader. Any driver supporting 3D should support this + /// driver. Lighting is supported. + ... [truncated message content] |
From: <ka...@us...> - 2010-02-01 18:16:00
|
Revision: 1227 http://agate.svn.sourceforge.net/agate/?rev=1227&view=rev Author: kanato Date: 2010-02-01 18:15:54 +0000 (Mon, 01 Feb 2010) Log Message: ----------- Delete horribly out of date XNA branch. Removed Paths: ------------- branches/xna/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-02-01 04:14:42
|
Revision: 1226 http://agate.svn.sourceforge.net/agate/?rev=1226&view=rev Author: kanato Date: 2010-02-01 04:14:36 +0000 (Mon, 01 Feb 2010) Log Message: ----------- Fix text on code generator button. Modified Paths: -------------- trunk/Tools/DatabaseEditor/Resources/CodeGen.bmp trunk/Tools/DatabaseEditor/frmEditor.Designer.cs Modified: trunk/Tools/DatabaseEditor/Resources/CodeGen.bmp =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseEditor/frmEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-31 19:27:39 UTC (rev 1225) +++ trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-02-01 04:14:36 UTC (rev 1226) @@ -49,17 +49,17 @@ this.btnNew = new System.Windows.Forms.ToolStripButton(); this.btnOpen = new System.Windows.Forms.ToolStripButton(); this.btnSave = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.btnCodeGen = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripContainer2 = new System.Windows.Forms.ToolStripContainer(); + this.databaseEditor1 = new AgateDatabaseEditor.DatabaseEditor(); this.tableToolStrip = new System.Windows.Forms.ToolStrip(); this.btnDesignTable = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.btnSortAscending = new System.Windows.Forms.ToolStripButton(); this.btnSortDescending = new System.Windows.Forms.ToolStripButton(); - this.databaseEditor1 = new AgateDatabaseEditor.DatabaseEditor(); - this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.btnCodeGen = new System.Windows.Forms.ToolStripButton(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.mainToolStrip.SuspendLayout(); @@ -238,6 +238,21 @@ this.btnSave.Text = "Save Database"; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25); + // + // btnCodeGen + // + this.btnCodeGen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnCodeGen.Image = global::AgateDatabaseEditor.Properties.Resources.CodeGen; + this.btnCodeGen.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnCodeGen.Name = "btnCodeGen"; + this.btnCodeGen.Size = new System.Drawing.Size(23, 22); + this.btnCodeGen.Text = "Generate Code"; + this.btnCodeGen.Click += new System.EventHandler(this.btnCodeGen_Click); + // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; @@ -267,6 +282,20 @@ this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.mainToolStrip); this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.tableToolStrip); // + // databaseEditor1 + // + this.databaseEditor1.Database = null; + this.databaseEditor1.DirtyState = false; + this.databaseEditor1.Dock = System.Windows.Forms.DockStyle.Fill; + this.databaseEditor1.Location = new System.Drawing.Point(0, 0); + this.databaseEditor1.Name = "databaseEditor1"; + this.databaseEditor1.Size = new System.Drawing.Size(862, 583); + this.databaseEditor1.TabIndex = 3; + this.databaseEditor1.Visible = false; + this.databaseEditor1.DirtyStateChanged += new System.EventHandler(this.databaseEditor1_DirtyStateChanged); + this.databaseEditor1.StatusText += new System.EventHandler<AgateDatabaseEditor.StatusTextEventArgs>(this.databaseEditor1_StatusText); + this.databaseEditor1.TableActiveStatusChanged += new System.EventHandler(this.databaseEditor1_TableActiveStatusChanged); + // // tableToolStrip // this.tableToolStrip.Dock = System.Windows.Forms.DockStyle.None; @@ -324,35 +353,6 @@ this.btnSortDescending.Text = "toolStripButton1"; this.btnSortDescending.Click += new System.EventHandler(this.btnSortDescending_Click); // - // databaseEditor1 - // - this.databaseEditor1.Database = null; - this.databaseEditor1.DirtyState = false; - this.databaseEditor1.Dock = System.Windows.Forms.DockStyle.Fill; - this.databaseEditor1.Location = new System.Drawing.Point(0, 0); - this.databaseEditor1.Name = "databaseEditor1"; - this.databaseEditor1.Size = new System.Drawing.Size(862, 583); - this.databaseEditor1.TabIndex = 3; - this.databaseEditor1.Visible = false; - this.databaseEditor1.DirtyStateChanged += new System.EventHandler(this.databaseEditor1_DirtyStateChanged); - this.databaseEditor1.StatusText += new System.EventHandler<AgateDatabaseEditor.StatusTextEventArgs>(this.databaseEditor1_StatusText); - this.databaseEditor1.TableActiveStatusChanged += new System.EventHandler(this.databaseEditor1_TableActiveStatusChanged); - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25); - // - // btnCodeGen - // - this.btnCodeGen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.btnCodeGen.Image = global::AgateDatabaseEditor.Properties.Resources.CodeGen; - this.btnCodeGen.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnCodeGen.Name = "btnCodeGen"; - this.btnCodeGen.Size = new System.Drawing.Size(23, 22); - this.btnCodeGen.Text = "toolStripButton1"; - this.btnCodeGen.Click += new System.EventHandler(this.btnCodeGen_Click); - // // frmEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-31 19:27:53
|
Revision: 1225 http://agate.svn.sourceforge.net/agate/?rev=1225&view=rev Author: kanato Date: 2010-01-31 19:27:39 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Fix updating of field value if value is deleted. Modified Paths: -------------- trunk/Tools/DatabaseEditor/TableEditor.cs Modified: trunk/Tools/DatabaseEditor/TableEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 18:41:25 UTC (rev 1224) +++ trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 19:27:39 UTC (rev 1225) @@ -205,7 +205,10 @@ try { - row[ColumnName(e.ColumnIndex)] = e.Value.ToString(); + string value = string.Empty; + if (e.Value != null) value = e.Value.ToString(); + + row[ColumnName(e.ColumnIndex)] = value; } catch (FormatException) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-31 18:41:32
|
Revision: 1224 http://agate.svn.sourceforge.net/agate/?rev=1224&view=rev Author: kanato Date: 2010-01-31 18:41:25 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Add button for code generation. Modified Paths: -------------- trunk/Tools/DatabaseEditor/DatabaseEditor.csproj trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs trunk/Tools/DatabaseEditor/Properties/Resources.resx trunk/Tools/DatabaseEditor/frmEditor.Designer.cs trunk/Tools/DatabaseEditor/frmEditor.cs trunk/Tools/DatabaseEditor/frmEditor.resx Added Paths: ----------- trunk/Tools/DatabaseEditor/Resources/CodeGen.bmp trunk/Tools/DatabaseEditor/Resources/openHS.png trunk/Tools/DatabaseEditor/Resources/saveHS.png Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.csproj =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2010-01-31 17:57:11 UTC (rev 1223) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2010-01-31 18:41:25 UTC (rev 1224) @@ -189,6 +189,15 @@ <ItemGroup> <None Include="Resources\NewDocumentHS.png" /> </ItemGroup> + <ItemGroup> + <None Include="Resources\openHS.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\saveHS.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\CodeGen.bmp" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2010-01-31 17:57:11 UTC (rev 1223) +++ trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2010-01-31 18:41:25 UTC (rev 1224) @@ -60,6 +60,13 @@ } } + internal static System.Drawing.Bitmap CodeGen { + get { + object obj = ResourceManager.GetObject("CodeGen", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap Error { get { object obj = ResourceManager.GetObject("Error", resourceCulture); @@ -81,6 +88,20 @@ } } + internal static System.Drawing.Bitmap openHS { + get { + object obj = ResourceManager.GetObject("openHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap saveHS { + get { + object obj = ResourceManager.GetObject("saveHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap warning { get { object obj = ResourceManager.GetObject("warning", resourceCulture); Modified: trunk/Tools/DatabaseEditor/Properties/Resources.resx =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Resources.resx 2010-01-31 17:57:11 UTC (rev 1223) +++ trunk/Tools/DatabaseEditor/Properties/Resources.resx 2010-01-31 18:41:25 UTC (rev 1224) @@ -118,16 +118,25 @@ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="NewDocumentHS" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\NewDocumentHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="openHS" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\openHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="Error" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\Error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="saveHS" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\saveHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="infoBubble" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\infoBubble.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> - <data name="NewDocumentHS" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>..\Resources\NewDocumentHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + <data name="CodeGen" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\CodeGen.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> </root> \ No newline at end of file Added: trunk/Tools/DatabaseEditor/Resources/CodeGen.bmp =================================================================== (Binary files differ) Property changes on: trunk/Tools/DatabaseEditor/Resources/CodeGen.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Tools/DatabaseEditor/Resources/openHS.png =================================================================== (Binary files differ) Property changes on: trunk/Tools/DatabaseEditor/Resources/openHS.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Tools/DatabaseEditor/Resources/saveHS.png =================================================================== (Binary files differ) Property changes on: trunk/Tools/DatabaseEditor/Resources/saveHS.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/Tools/DatabaseEditor/frmEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-31 17:57:11 UTC (rev 1223) +++ trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-31 18:41:25 UTC (rev 1224) @@ -49,14 +49,17 @@ this.btnNew = new System.Windows.Forms.ToolStripButton(); this.btnOpen = new System.Windows.Forms.ToolStripButton(); this.btnSave = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripContainer2 = new System.Windows.Forms.ToolStripContainer(); - this.databaseEditor1 = new AgateDatabaseEditor.DatabaseEditor(); this.tableToolStrip = new System.Windows.Forms.ToolStrip(); this.btnDesignTable = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.btnSortAscending = new System.Windows.Forms.ToolStripButton(); this.btnSortDescending = new System.Windows.Forms.ToolStripButton(); + this.databaseEditor1 = new AgateDatabaseEditor.DatabaseEditor(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.btnCodeGen = new System.Windows.Forms.ToolStripButton(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.mainToolStrip.SuspendLayout(); @@ -111,6 +114,7 @@ // // newDatabaseToolStripMenuItem // + this.newDatabaseToolStripMenuItem.Image = global::AgateDatabaseEditor.Properties.Resources.NewDocumentHS; this.newDatabaseToolStripMenuItem.Name = "newDatabaseToolStripMenuItem"; this.newDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.newDatabaseToolStripMenuItem.Text = "&New Database"; @@ -118,6 +122,7 @@ // // openDatabaseToolStripMenuItem // + this.openDatabaseToolStripMenuItem.Image = global::AgateDatabaseEditor.Properties.Resources.openHS; this.openDatabaseToolStripMenuItem.Name = "openDatabaseToolStripMenuItem"; this.openDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.openDatabaseToolStripMenuItem.Text = "&Open Database..."; @@ -125,6 +130,7 @@ // // saveDatabaseToolStripMenuItem // + this.saveDatabaseToolStripMenuItem.Image = global::AgateDatabaseEditor.Properties.Resources.saveHS; this.saveDatabaseToolStripMenuItem.Name = "saveDatabaseToolStripMenuItem"; this.saveDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.saveDatabaseToolStripMenuItem.Text = "&Save Database"; @@ -193,10 +199,12 @@ this.mainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.btnNew, this.btnOpen, - this.btnSave}); + this.btnSave, + this.toolStripSeparator5, + this.btnCodeGen}); this.mainToolStrip.Location = new System.Drawing.Point(3, 24); this.mainToolStrip.Name = "mainToolStrip"; - this.mainToolStrip.Size = new System.Drawing.Size(81, 25); + this.mainToolStrip.Size = new System.Drawing.Size(141, 25); this.mainToolStrip.TabIndex = 4; this.mainToolStrip.Text = "toolStrip1"; // @@ -207,29 +215,34 @@ this.btnNew.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnNew.Name = "btnNew"; this.btnNew.Size = new System.Drawing.Size(23, 22); - this.btnNew.Text = "toolStripButton1"; + this.btnNew.Text = "New Database"; this.btnNew.Click += new System.EventHandler(this.btnNew_Click); // // btnOpen // this.btnOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.btnOpen.Image = ((System.Drawing.Image)(resources.GetObject("btnOpen.Image"))); + this.btnOpen.Image = global::AgateDatabaseEditor.Properties.Resources.openHS; this.btnOpen.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnOpen.Name = "btnOpen"; this.btnOpen.Size = new System.Drawing.Size(23, 22); - this.btnOpen.Text = "toolStripButton2"; + this.btnOpen.Text = "Open Database"; this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click); // // btnSave // this.btnSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image"))); + this.btnSave.Image = global::AgateDatabaseEditor.Properties.Resources.saveHS; this.btnSave.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(23, 22); - this.btnSave.Text = "toolStripButton3"; + this.btnSave.Text = "Save Database"; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25); + // // toolStripContainer2 // // @@ -254,20 +267,6 @@ this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.mainToolStrip); this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.tableToolStrip); // - // databaseEditor1 - // - this.databaseEditor1.Database = null; - this.databaseEditor1.DirtyState = false; - this.databaseEditor1.Dock = System.Windows.Forms.DockStyle.Fill; - this.databaseEditor1.Location = new System.Drawing.Point(0, 0); - this.databaseEditor1.Name = "databaseEditor1"; - this.databaseEditor1.Size = new System.Drawing.Size(862, 583); - this.databaseEditor1.TabIndex = 3; - this.databaseEditor1.Visible = false; - this.databaseEditor1.DirtyStateChanged += new System.EventHandler(this.databaseEditor1_DirtyStateChanged); - this.databaseEditor1.StatusText += new System.EventHandler<AgateDatabaseEditor.StatusTextEventArgs>(this.databaseEditor1_StatusText); - this.databaseEditor1.TableActiveStatusChanged += new System.EventHandler(this.databaseEditor1_TableActiveStatusChanged); - // // tableToolStrip // this.tableToolStrip.Dock = System.Windows.Forms.DockStyle.None; @@ -278,7 +277,7 @@ this.toolStripLabel1, this.btnSortAscending, this.btnSortDescending}); - this.tableToolStrip.Location = new System.Drawing.Point(84, 24); + this.tableToolStrip.Location = new System.Drawing.Point(144, 24); this.tableToolStrip.Name = "tableToolStrip"; this.tableToolStrip.Size = new System.Drawing.Size(177, 25); this.tableToolStrip.TabIndex = 10; @@ -325,6 +324,35 @@ this.btnSortDescending.Text = "toolStripButton1"; this.btnSortDescending.Click += new System.EventHandler(this.btnSortDescending_Click); // + // databaseEditor1 + // + this.databaseEditor1.Database = null; + this.databaseEditor1.DirtyState = false; + this.databaseEditor1.Dock = System.Windows.Forms.DockStyle.Fill; + this.databaseEditor1.Location = new System.Drawing.Point(0, 0); + this.databaseEditor1.Name = "databaseEditor1"; + this.databaseEditor1.Size = new System.Drawing.Size(862, 583); + this.databaseEditor1.TabIndex = 3; + this.databaseEditor1.Visible = false; + this.databaseEditor1.DirtyStateChanged += new System.EventHandler(this.databaseEditor1_DirtyStateChanged); + this.databaseEditor1.StatusText += new System.EventHandler<AgateDatabaseEditor.StatusTextEventArgs>(this.databaseEditor1_StatusText); + this.databaseEditor1.TableActiveStatusChanged += new System.EventHandler(this.databaseEditor1_TableActiveStatusChanged); + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25); + // + // btnCodeGen + // + this.btnCodeGen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnCodeGen.Image = global::AgateDatabaseEditor.Properties.Resources.CodeGen; + this.btnCodeGen.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnCodeGen.Name = "btnCodeGen"; + this.btnCodeGen.Size = new System.Drawing.Size(23, 22); + this.btnCodeGen.Text = "toolStripButton1"; + this.btnCodeGen.Click += new System.EventHandler(this.btnCodeGen_Click); + // // frmEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -384,6 +412,9 @@ private System.Windows.Forms.ToolStripLabel toolStripLabel1; private System.Windows.Forms.ToolStripButton btnSortAscending; private System.Windows.Forms.ToolStripButton btnSortDescending; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + private System.Windows.Forms.ToolStripButton btnCodeGen; } } Modified: trunk/Tools/DatabaseEditor/frmEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-31 17:57:11 UTC (rev 1223) +++ trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-31 18:41:25 UTC (rev 1224) @@ -164,23 +164,7 @@ } private void generateCodeToolStripMenuItem_Click(object sender, EventArgs e) { - frmCodeGenerator frm = new frmCodeGenerator(); - - frm.Namespace = databaseEditor1.Database.CodeNamespace; - frm.StartDirectory = System.IO.Path.GetDirectoryName(filename); - - if (frm.ShowDialog() == DialogResult.OK) - { - databaseEditor1.Database.CodeNamespace = frm.Namespace; - - GenerateCode(frm.CodeDomProviderType, frm.Directory, frm.Namespace); - - MessageBox.Show("Code generation completed.", - "Code Generation", MessageBoxButtons.OK, - MessageBoxIcon.Information); - } - - databaseEditor1.DirtyState = true; + GenerateCode(); } private void importDataToolStripMenuItem_Click(object sender, EventArgs e) { @@ -227,10 +211,35 @@ databaseEditor1.CurrentTableSortDescending(); } + private void btnCodeGen_Click(object sender, EventArgs e) + { + GenerateCode(); + } + #endregion #region --- Code generation --- + private void GenerateCode() + { + frmCodeGenerator frm = new frmCodeGenerator(); + + frm.Namespace = databaseEditor1.Database.CodeNamespace; + frm.StartDirectory = System.IO.Path.GetDirectoryName(filename); + + if (frm.ShowDialog() == DialogResult.OK) + { + databaseEditor1.Database.CodeNamespace = frm.Namespace; + + GenerateCode(frm.CodeDomProviderType, frm.Directory, frm.Namespace); + + MessageBox.Show("Code generation completed.", + "Code Generation", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + + databaseEditor1.DirtyState = true; + } private void GenerateCode(Type type, string directory, string theNamespace) { GenerateCode((System.CodeDom.Compiler.CodeDomProvider) @@ -296,5 +305,6 @@ #endregion + } } Modified: trunk/Tools/DatabaseEditor/frmEditor.resx =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.resx 2010-01-31 17:57:11 UTC (rev 1223) +++ trunk/Tools/DatabaseEditor/frmEditor.resx 2010-01-31 18:41:25 UTC (rev 1224) @@ -132,43 +132,10 @@ <metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>539, 27</value> </metadata> - <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - <data name="btnOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value> - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJzSURBVDhPvZNJSBRgGIbn0KFLFpmRCEmWiAWDgSHVQcSI - cqVcQckFy40yQzHHpRnX0dncpnTQZlwadbSyFMMKoVAkQsuFElOzoKgUU0Mlt6dxBMmyg5d+eC8/3/t8 - 7/cvAsH/WNkl1a6SQj3X8yrJVRtIkelSt9Q3NEGNT7QieNV0ObnCIsMIS8zS+oUklCBorFEFGMWfaq3L - VfyrS7So1NM3VoF3dIEJwFCfjvmpBpN+TupZHNdiqFTQVJOZsRnEJ0aJd1QhHpHFCBqqlMxN1m4wL38p - ZXEgntrbeVSX5aAtyUBTkM4tuYhiaRIboHU6GXPfdOudV4xmhkQwELmp/gLcKZfy47PGFHvV3NYoM+mR - IZ9mvZT71TkYtJnoNRIq1TeoKEylTClCLUteS1OtyWHmQxGrsUc7xDTVKlkelcBY1ka9N+6NpMBgAryJ - pbfen7gwryqBVp3J9HAefJTzoE5B12P5WtHvI7wOgW5fljrdmX/iwrsqIREXnKevRngeEZQXivn+VsJY - ZxpNejkrI2Loj1oD9IYbjYEsdXkx336amdaTTDQeRRJtS6CreYHpMEuVaUz0JXO3RkbPc2OSwXgj4CL0 - BLPy4hwLz84y2+bMZJMjX+vs6c7eRZC7DY52O+xMAHW+iP72dO7V5MNwOrwyxn3px0KHB7NPXZhqdmLc - IOST7hADcnPEkQdxOGzZsn6VRblJNFTmMfAwhm6VYF1d8m20S7fTkrGT+lQLtElW3LxmTZDbgRUnB2u3 - dYAqKxGV+BK5yaGkXAkgLtyLMP9TnD9zHNcTQo4JbbG3sWK/5R727jZjn7nZxoe0pV+1SfEv1Trk/R1X - IaIAAAAASUVORK5CYII= -</value> - </data> - <data name="btnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value> - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAItSURBVDhPrZPdS5NxFMf9F7zvJvCi25oaw7VYDZ5yDmXZ - MKyIUp/wNU2X+UKKpWnU8gWyFS6dtFpNwklFvoApYiKLpWhl5oqmOHxFJ4LBt9/5Rc8v07rJH5zLz+c8 - 55zvExa2E+/F8xCoPO0raHMv45FzAS3NQdyzzaCh/hust/y4XjWJ8rKPKC4aQ0H+CC7k+KD0JrCnG6iv - W8e/3tr6BgxJPTiR9IyXInA/XeKCmurFv/IEBxfWcND0EiqVDPNxlxA4H85zQXnZ9LaCX/DnwBIijR4U - XZ7CMVOrENibZrngkuXTFsHv8LuJIPZIbuTljiMh3i4EjXcCXJCdNbJJ8Cc84Atgl84JWR6G0WgTgrra - r1wgpw0rgu3g7qEvCI9pxslTrxEb2yAEN2qm0NUJdkrgzLk3MJ/u59umhdHM9NnU+Sfci0TzK0iSVQiu - VkygwwOWAaDV8Z3dfRVVlXN8qbQwmjkzw6fAcQnt0OurhaCkeByux8AD+wYLTgiG5NxNZTprQXJ6Ke8c - F8/goy7odBVCYCkYZTBQezvEO5OAhQSRGgneD7MYnZyDnH8Nhw1tHNYcckCrLRUCiqXtLpTPJgHB5wtv - 4r1/Hv6ZZVy8YkWUzsHgFkQduA9NTKEQZGa8ZXOv8Jkj9C7s3ifhSUcfPJ0D6OodQv+gF0eMZqi0TYhm - 8F51I9TqPCHISvcmpqb08XhSwigkdGc6FW2bFkYzU1cqgvdHZwvB//zRPwBCVjq+3Cul5wAAAABJRU5E - rkJggg== -</value> - </data> <metadata name="tableToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>667, 27</value> </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="btnDesignTable.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -189,11 +156,11 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF8SURBVDhPY2CAAq/6kxL2Bfu/WsYsEoOJ4aD/YxX3LDq4 yjV7+3+r8GmlZBnglrv1nn3iuofGwT0vSTbAteCgk2v2+u+W8fM1jAM6/1tGzgzAYwimF1wzt592TF53 - yyxs0jSTwKYv5iGTDhJtQGjoKmb7lO0f7bO2SIA0WUTO8DX27/hvFj1di6hAdMnceswstOOHRdjkFGOf + yyxs0jSTwPov5iGTDhJtQGjoKmb7lO0f7bO2SIA0WUTO8DX27/hvFj1di6hAdMnceswstP6HRdjkFGOf mVzG7u3vQQYY+7dfJMoAAgGGTRozDCZH5K2dHJq+c3pk4dypUQW7Jrp6Xewx0kgh2gWT3QO3gRTPjkgW n+rh8aJWS+ke0YEIUjjN1RWc+mYGxs6s01f9X6+vFobFgEagmDcQg7zgCsRdKGrmhGc5T3L3/V+np7oK h+3GUM0gA0DYCUXd1Oj8B12Gai9azXXEQRJTHB21sRi0Bar5GIrctLCs3n57u/8dRhqpIImJHjainYYa - S7EYAHMFwvYp7r7a9cZKX4rUlL7W6qnMbjJQWVGsJfeqWld5Lg6vVJMR9bi1AACIXoZusvzemwAAAABJ + S7EYAHMFwvYp7r7a9cZKX4rUlL7W6qnMbjJQWVGsJfeqWld5Lg6vVJMR9bi1AABo2IZiNh2vkgAAAABJ RU5ErkJggg== </value> </data> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-31 17:57:19
|
Revision: 1223 http://agate.svn.sourceforge.net/agate/?rev=1223&view=rev Author: kanato Date: 2010-01-31 17:57:11 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Implement column reordering. Modified Paths: -------------- trunk/AgateLib/Data/AgateColumn.cs trunk/AgateLib/Data/AgateColumnDictionary.cs trunk/AgateLib/Data/AgateRow.cs trunk/AgateLib/Data/AgateTable.cs trunk/Tools/DatabaseEditor/TableEditor.Designer.cs trunk/Tools/DatabaseEditor/TableEditor.cs trunk/Tools/DatabaseEditor/frmDesignTable.cs trunk/Tools/DatabaseEditor/frmEditor.Designer.cs trunk/Tools/DatabaseEditor/frmEditor.resx Modified: trunk/AgateLib/Data/AgateColumn.cs =================================================================== --- trunk/AgateLib/Data/AgateColumn.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/AgateLib/Data/AgateColumn.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -58,7 +58,6 @@ info.Write("ColumnWidth", mColumnWidth); } } - void IXleSerializable.ReadData(XleSerializationInfo info) { mName = info.ReadString("Name"); @@ -85,6 +84,12 @@ get { return mColumnWidth; } set { mColumnWidth = value; } } + /// <summary> + /// Gets or sets the display index of this column. + /// When saved, columns are sorted by their display index. + /// </summary> + [Browsable(false)] + public int DisplayIndex { get; set; } public string DefaultValue { @@ -190,5 +195,10 @@ { mNextAutoIncrementValue++; } + + internal void SetNextAutoIncrementValue(int value) + { + mNextAutoIncrementValue = value; + } } } Modified: trunk/AgateLib/Data/AgateColumnDictionary.cs =================================================================== --- trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -31,7 +31,7 @@ { get { - var result = mColumns.First(x => x.Name == name); + var result = mColumns.FirstOrDefault(x => x.Name == name); if (result == null) throw new ArgumentException("Column does not exist."); @@ -50,12 +50,25 @@ internal void Add(AgateColumn col) { + if (col == null) + throw new ArgumentNullException("Cannot add a null column."); + if (mColumns.Any(x => x.Name == col.Name)) throw new ArgumentException("Column " + col.Name + " already exists."); mColumns.Add(col); } + internal void Insert(int newIndex, AgateColumn col) + { + if (col == null) + throw new ArgumentNullException("Cannot add a null column."); + if (mColumns.Any(x => x.Name == col.Name)) + throw new ArgumentException("Column " + col.Name + " already exists."); + + mColumns.Insert(newIndex, col); + } + public override string ToString() { return "Columns: " + mColumns.Count; @@ -79,6 +92,11 @@ } } + internal void Remove(int index) + { + mColumns.RemoveAt(index); + } + #region IEnumerable<AgateColumn> Members public IEnumerator<AgateColumn> GetEnumerator() @@ -95,5 +113,12 @@ } #endregion + + + + public void SortByDisplayIndex() + { + mColumns.Sort((x, y) => x.DisplayIndex.CompareTo(y.DisplayIndex)); + } } } Modified: trunk/AgateLib/Data/AgateRow.cs =================================================================== --- trunk/AgateLib/Data/AgateRow.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/AgateLib/Data/AgateRow.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -7,38 +7,38 @@ { public class AgateRow { - Dictionary<string, string> values = new Dictionary<string, string>(); - AgateTable parentTable; + Dictionary<string, string> mValues = new Dictionary<string, string>(); + AgateTable mParentTable; public AgateRow(AgateTable parentTable) { - this.parentTable = parentTable; + this.mParentTable = parentTable; foreach (var column in parentTable.Columns) { - values[column.Name] = null; + mValues[column.Name] = null; } } public AgateRow Clone() { - AgateRow retval = new AgateRow(parentTable); + AgateRow retval = new AgateRow(mParentTable); - foreach (var value in values) - retval.values[value.Key] = value.Value; + foreach (var value in mValues) + retval.mValues[value.Key] = value.Value; return retval; } public AgateTable ParentTable { - get { return parentTable; } + get { return mParentTable; } internal set { - parentTable = value; + mParentTable = value; - if (parentTable != null) + if (mParentTable != null) { - ValidateData(parentTable); + ValidateData(mParentTable); } } } @@ -50,31 +50,40 @@ /// <returns></returns> public string this[AgateColumn column] { - get { return values[column.Name]; } + get { return mValues[column.Name]; } set { - ValidateTypeOrThrow(column.Name, value); - if (column.FieldType == FieldType.AutoNumber) throw new AgateDatabaseException("Cannot write to autonumber field."); - values[column.Name] = value; + string oldValue = mValues[column.Name]; + mValues[column.Name] = value; + + try + { + ValidateTypeOrThrow(column); + } + catch + { + mValues[column.Name] = oldValue; + throw; + } } } public string this[string key] { - get { return values[key]; } + get { return mValues[key]; } set { - this[parentTable.Columns[key]] = value; + this[mParentTable.Columns[key]] = value; - values[key] = value; + mValues[key] = value; } } internal void WriteWithoutValidation(AgateColumn column, string value) { - values[column.Name] = value; + mValues[column.Name] = value; } public override string ToString() @@ -82,7 +91,7 @@ StringBuilder b = new StringBuilder(); int count = 0; - foreach (var column in parentTable.Columns) + foreach (var column in mParentTable.Columns) { string value = AgateDataHelper.FixString(this[column.Name]); @@ -97,9 +106,31 @@ return b.ToString(); } - private void ValidateTypeOrThrow(string key, string value) + private void ValidateTypeOrThrow(AgateColumn column) { - Convert.ChangeType(value, AgateDataHelper.FromFieldType(parentTable.Columns[key].FieldType)); + if (mValues.ContainsKey(column.Name) == false || + string.IsNullOrEmpty(this[column])) + { + switch (column.FieldType) + { + case FieldType.Int16: + case FieldType.Int32: + case FieldType.SByte: + case FieldType.Single: + case FieldType.Decimal: + case FieldType.Boolean: + case FieldType.Byte: + case FieldType.DateTime: + case FieldType.Double: + case FieldType.UInt16: + case FieldType.UInt32: + case FieldType.String: + mValues[column.Name] = column.DefaultValue; + break; + } + } + + Convert.ChangeType(mValues[column.Name], column.FieldTypeDataType); } internal void ValidateData(AgateTable agateTable) @@ -107,22 +138,22 @@ foreach (var column in agateTable.Columns) { if (column.FieldType == FieldType.AutoNumber && - (values.ContainsKey(column.Name) == false || - values[column.Name] == null)) + (mValues.ContainsKey(column.Name) == false || + mValues[column.Name] == null)) { int value = column.NextAutoIncrementValue; column.IncrementNextAutoIncrementValue(); - values[column.Name] = value.ToString(); + mValues[column.Name] = value.ToString(); } - if (values.ContainsKey(column.Name)) + if (mValues.ContainsKey(column.Name)) { - ValidateTypeOrThrow(column.Name, values[column.Name]); + ValidateTypeOrThrow(column); } else { - values.Add(column.Name, null); + mValues.Add(column.Name, null); } if (column.PrimaryKey) @@ -145,10 +176,14 @@ internal void OnColumnNameChange(string oldName, string newName) { - string value = values[oldName]; - values[newName] = value; + string value = mValues[oldName]; + mValues[newName] = value; - values.Remove(oldName); + mValues.Remove(oldName); } + internal void OnDeleteColumn(string text) + { + mValues.Remove(text); + } } } Modified: trunk/AgateLib/Data/AgateTable.cs =================================================================== --- trunk/AgateLib/Data/AgateTable.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/AgateLib/Data/AgateTable.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -44,6 +44,8 @@ void IXleSerializable.WriteData(XleSerializationInfo info) { + mColumns.SortByDisplayIndex(); + info.Write("Name", mName); info.Write("Version", "0.4.0"); info.Write("Columns", mColumns.ColumnList); @@ -63,6 +65,9 @@ } else throw new AgateDatabaseException("Unsupported database version."); + + for (int i = 0; i < mColumns.Count; i++) + mColumns[i].DisplayIndex = i; } private string RowString() @@ -143,23 +148,34 @@ get { return mRows; } } + + internal void Validate() + { + foreach (var row in mRows) + row.ValidateData(this); + } + public void AddColumn(AgateColumn col) { mColumns.Add(col); + if (col.FieldType == FieldType.AutoNumber) + { + + } mRows.ForEach(x => x.ValidateData(this)); } - internal void Validate() + public void RemoveColumn(int index) { - foreach (var row in mRows) - row.ValidateData(this); - } + string text = mColumns[index].Name; + foreach (var row in Rows) + { + row.OnDeleteColumn(text); + } - public void RemoveColumn(int index) - { - throw new NotImplementedException(); + mColumns.Remove(index); } public void OverwriteColumn(int index, AgateColumn newColumn) @@ -175,9 +191,17 @@ if (old.FieldType != newColumn.FieldType) { + try { Validate(); + + if (newColumn.FieldType == FieldType.AutoNumber) + { + int max = Rows.Max(x => int.Parse(x[newColumn])); + + newColumn.SetNextAutoIncrementValue(max + 1); + } } catch { @@ -193,5 +217,13 @@ } + + public void MoveColumn(int oldIndex, int newIndex) + { + AgateColumn col = mColumns[oldIndex]; + + mColumns.Remove(oldIndex); + mColumns.Insert(newIndex, col); + } } } Modified: trunk/Tools/DatabaseEditor/TableEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.Designer.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/Tools/DatabaseEditor/TableEditor.Designer.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -50,6 +50,7 @@ this.gridView.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.gridView_UserDeletingRow); this.gridView.CancelRowEdit += new System.Windows.Forms.QuestionEventHandler(this.gridView_CancelRowEdit); this.gridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.gridView_CellValueNeeded); + this.gridView.ColumnDisplayIndexChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.gridView_ColumnDisplayIndexChanged); this.gridView.RowValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridView_RowValidated); this.gridView.RowDirtyStateNeeded += new System.Windows.Forms.QuestionEventHandler(this.gridView_RowDirtyStateNeeded); this.gridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.gridView_CellValuePushed); Modified: trunk/Tools/DatabaseEditor/TableEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -66,11 +66,14 @@ return; } + mTable.Columns.SortByDisplayIndex(); + int index = 0; foreach (var column in mTable.Columns) { DataGridViewColumn col = new DataGridViewColumn(); + col.Tag = column; col.Name = column.Name; col.ReadOnly = column.FieldType == FieldType.AutoNumber; @@ -161,21 +164,18 @@ } private void gridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) { - if (e.RowIndex == gridView.RowCount - 1) - return; - if (e.RowIndex >= mTable.Rows.Count) - return; - AgateRow row = null; if (e.RowIndex == mEditingRowIndex) row = mEditingRow; - else + else if (e.RowIndex >= mTable.Rows.Count) + return; + else row = mTable.Rows[e.RowIndex]; string value = row[ColumnName(e.ColumnIndex)]; - if (mTable.Columns[e.ColumnIndex].FieldType == FieldType.Boolean) + if (mTable.Columns[ColumnName(e.ColumnIndex)].FieldType == FieldType.Boolean) { e.Value = bool.Parse(value); } @@ -348,6 +348,15 @@ return null; } } + + private void gridView_ColumnDisplayIndexChanged(object sender, DataGridViewColumnEventArgs e) + { + AgateColumn col = e.Column.Tag as AgateColumn; + + col.DisplayIndex = e.Column.DisplayIndex; + + OnSetDirtyFlag(); + } } public class StatusTextEventArgs : EventArgs Modified: trunk/Tools/DatabaseEditor/frmDesignTable.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmDesignTable.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/Tools/DatabaseEditor/frmDesignTable.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -75,6 +75,8 @@ if (e.RowIndex == mRowInEdit) col = mColumnInEdit; + else if (e.RowIndex >= mTable.Columns.Count) + return; else col = mTable.Columns[e.RowIndex]; @@ -134,7 +136,8 @@ { // Save row changes if any were made and release the edited // Column object if there is one. - if (e.RowIndex >= mTable.Columns.Count && + if (mColumnInEdit != null && + e.RowIndex >= mTable.Columns.Count && e.RowIndex != gridColumns.Rows.Count - 1) { // Add the new Column object to the data store. Modified: trunk/Tools/DatabaseEditor/frmEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-31 17:57:11 UTC (rev 1223) @@ -74,7 +74,7 @@ this.statusLabel}); this.statusStrip1.Location = new System.Drawing.Point(0, 0); this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(632, 22); + this.statusStrip1.Size = new System.Drawing.Size(862, 22); this.statusStrip1.TabIndex = 0; this.statusStrip1.Text = "statusStrip1"; // @@ -92,7 +92,7 @@ this.toolsToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(632, 24); + this.menuStrip1.Size = new System.Drawing.Size(862, 24); this.menuStrip1.TabIndex = 2; this.menuStrip1.Text = "menuStrip1"; // @@ -240,11 +240,11 @@ // toolStripContainer2.ContentPanel // this.toolStripContainer2.ContentPanel.Controls.Add(this.databaseEditor1); - this.toolStripContainer2.ContentPanel.Size = new System.Drawing.Size(632, 480); + this.toolStripContainer2.ContentPanel.Size = new System.Drawing.Size(862, 583); this.toolStripContainer2.Dock = System.Windows.Forms.DockStyle.Fill; this.toolStripContainer2.Location = new System.Drawing.Point(0, 0); this.toolStripContainer2.Name = "toolStripContainer2"; - this.toolStripContainer2.Size = new System.Drawing.Size(632, 551); + this.toolStripContainer2.Size = new System.Drawing.Size(862, 654); this.toolStripContainer2.TabIndex = 6; this.toolStripContainer2.Text = "toolStripContainer2"; // @@ -261,7 +261,7 @@ this.databaseEditor1.Dock = System.Windows.Forms.DockStyle.Fill; this.databaseEditor1.Location = new System.Drawing.Point(0, 0); this.databaseEditor1.Name = "databaseEditor1"; - this.databaseEditor1.Size = new System.Drawing.Size(632, 480); + this.databaseEditor1.Size = new System.Drawing.Size(862, 583); this.databaseEditor1.TabIndex = 3; this.databaseEditor1.Visible = false; this.databaseEditor1.DirtyStateChanged += new System.EventHandler(this.databaseEditor1_DirtyStateChanged); @@ -280,7 +280,7 @@ this.btnSortDescending}); this.tableToolStrip.Location = new System.Drawing.Point(84, 24); this.tableToolStrip.Name = "tableToolStrip"; - this.tableToolStrip.Size = new System.Drawing.Size(208, 25); + this.tableToolStrip.Size = new System.Drawing.Size(177, 25); this.tableToolStrip.TabIndex = 10; this.tableToolStrip.Text = "toolStrip1"; // @@ -329,7 +329,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(632, 551); + this.ClientSize = new System.Drawing.Size(862, 654); this.Controls.Add(this.toolStripContainer2); this.MainMenuStrip = this.menuStrip1; this.Name = "frmEditor"; Modified: trunk/Tools/DatabaseEditor/frmEditor.resx =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.resx 2010-01-31 09:09:00 UTC (rev 1222) +++ trunk/Tools/DatabaseEditor/frmEditor.resx 2010-01-31 17:57:11 UTC (rev 1223) @@ -187,13 +187,13 @@ <data name="btnSortAscending.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF8SURBVDhPY2CAAq/6kxIOBfu/WsYsEoOJ4aD/YxX3LDq4 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF8SURBVDhPY2CAAq/6kxL2Bfu/WsYsEoOJ4aD/YxX3LDq4 yjV7+3+r8GmlZBnglrv1nn3iuofGwT0vSTbAteCgk2v2+u+W8fM1jAM6/1tGzgzAYwimF1wzt592TF53 - yyxs0jSTwOYv5iGTDhJtQGjoKmb7lO0f7bO2SIA0WUTO8DX27/hvFj1di6hAdMnceswstPOHRdjkFGOf + yyxs0jSTwKYv5iGTDhJtQGjoKmb7lO0f7bO2SIA0WUTO8DX27/hvFj1di6hAdMnceswstOOHRdjkFGOf mVzG7u3vQQYY+7dfJMoAAgGGTRozDCZH5K2dHJq+c3pk4dypUQW7Jrp6Xewx0kgh2gWT3QO3gRTPjkgW n+rh8aJWS+ke0YEIUjjN1RWc+mYGxs6s01f9X6+vFobFgEagmDcQg7zgCsRdKGrmhGc5T3L3/V+np7oK h+3GUM0gA0DYCUXd1Oj8B12Gai9azXXEQRJTHB21sRi0Bar5GIrctLCs3n57u/8dRhqpIImJHjainYYa - S7EYAHMFwvYp7r7aDcZKX4rUlL7W6qnMbjJQWVGsJfeqWld5Lg6vVJMR9bi1AACSWoZyM6QFpAAAAABJ + S7EYAHMFwvYp7r7a9cZKX4rUlL7W6qnMbjJQWVGsJfeqWld5Lg6vVJMR9bi1AACIXoZusvzemwAAAABJ RU5ErkJggg== </value> </data> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-31 09:09:12
|
Revision: 1222 http://agate.svn.sourceforge.net/agate/?rev=1222&view=rev Author: kanato Date: 2010-01-31 09:09:00 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Correct some errors when deleting rows. Modified Paths: -------------- trunk/Tools/DatabaseEditor/DatabaseEditor.cs trunk/Tools/DatabaseEditor/TableEditor.cs trunk/Tools/DatabaseEditor/frmEditor.cs Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-31 09:07:35 UTC (rev 1221) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-31 09:09:00 UTC (rev 1222) @@ -479,8 +479,6 @@ CurrentTable.EditColumns(); DirtyState = true; - - throw new NotImplementedException(); } internal void CurrentTableSortAscending() Modified: trunk/Tools/DatabaseEditor/TableEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 09:07:35 UTC (rev 1221) +++ trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 09:09:00 UTC (rev 1222) @@ -163,6 +163,8 @@ { if (e.RowIndex == gridView.RowCount - 1) return; + if (e.RowIndex >= mTable.Rows.Count) + return; AgateRow row = null; @@ -222,7 +224,8 @@ } private void gridView_RowValidated(object sender, DataGridViewCellEventArgs e) { - if (e.RowIndex >= mTable.Rows.Count && + if (mEditingRow != null && + e.RowIndex >= mTable.Rows.Count && e.RowIndex != gridView.Rows.Count - 1) { mTable.Rows.Add(mEditingRow); Modified: trunk/Tools/DatabaseEditor/frmEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-31 09:07:35 UTC (rev 1221) +++ trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-31 09:09:00 UTC (rev 1222) @@ -119,6 +119,8 @@ return false; } + databaseEditor1.DirtyState = false; + return true; } /// <summary> @@ -212,7 +214,6 @@ Save(); } - private void btnDesignTable_Click(object sender, EventArgs e) { databaseEditor1.DesignCurrentTable(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-31 09:07:41
|
Revision: 1221 http://agate.svn.sourceforge.net/agate/?rev=1221&view=rev Author: kanato Date: 2010-01-31 09:07:35 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Throw exception on null row addition. Modified Paths: -------------- trunk/AgateLib/Data/AgateRowList.cs Modified: trunk/AgateLib/Data/AgateRowList.cs =================================================================== --- trunk/AgateLib/Data/AgateRowList.cs 2010-01-31 08:10:27 UTC (rev 1220) +++ trunk/AgateLib/Data/AgateRowList.cs 2010-01-31 09:07:35 UTC (rev 1221) @@ -114,6 +114,9 @@ public void Add(AgateRow row) { + if (row == null) + throw new ArgumentNullException("Cannot add a null row."); + row.ParentTable.Rows.Remove(row); row.ParentTable = mParentTable; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-31 08:10:37
|
Revision: 1220 http://agate.svn.sourceforge.net/agate/?rev=1220&view=rev Author: kanato Date: 2010-01-31 08:10:27 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Implement row sorting. Add toolbars for common operations. Modified Paths: -------------- trunk/Tools/DatabaseEditor/DatabaseEditor.cs trunk/Tools/DatabaseEditor/DatabaseEditor.csproj trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs trunk/Tools/DatabaseEditor/Properties/Resources.resx trunk/Tools/DatabaseEditor/TableEditor.Designer.cs trunk/Tools/DatabaseEditor/TableEditor.cs trunk/Tools/DatabaseEditor/frmDesignTable.cs trunk/Tools/DatabaseEditor/frmEditor.Designer.cs trunk/Tools/DatabaseEditor/frmEditor.cs trunk/Tools/DatabaseEditor/frmEditor.resx Added Paths: ----------- trunk/Tools/DatabaseEditor/Resources/NewDocumentHS.png Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-31 08:10:27 UTC (rev 1220) @@ -42,7 +42,7 @@ if (Database == null) { tabs.TabPages.Clear(); - + return; } @@ -59,7 +59,7 @@ lstTables.Items.Add(newTable); - + foreach (var table in Database.Tables) { ListViewItem item = new ListViewItem(table.Name); @@ -79,7 +79,7 @@ if (ed == null) continue; - if (Database.Tables.Contains(ed.AgateTable) == false) + if (Database.Tables.Contains(ed.Table) == false) { pagesToRemove.Add(tab); } @@ -89,6 +89,28 @@ tabs.TabPages.Remove(tab); } + + public bool IsTableActive + { + get + { + if (tabs.TabPages.Count == 0) + return false; + + if (tabs.SelectedTab.Controls[0] is TableEditor) + return true; + + return false; + } + } + + void OnTableActiveStatusChanged() + { + if (TableActiveStatusChanged != null) + TableActiveStatusChanged(this, EventArgs.Empty); + } + public event EventHandler TableActiveStatusChanged; + private void lstTables_DoubleClick(object sender, EventArgs e) { openToolStripMenuItem_Click(sender, e); @@ -120,7 +142,7 @@ { TableEditor editor = new TableEditor(); editor.Database = Database; - editor.AgateTable = table; + editor.Table = table; editor.Dock = DockStyle.Fill; editor.StatusText += new EventHandler<StatusTextEventArgs>(editor_StatusText); editor.SetDirtyFlag += new EventHandler(editor_SetDirtyFlag); @@ -132,6 +154,8 @@ } tabs.SelectedTab = page; + + OnTableActiveStatusChanged(); } void editor_SetDirtyFlag(object sender, EventArgs e) @@ -160,7 +184,7 @@ { TableEditor tb = (TableEditor)ctrl; - if (tb.AgateTable == table) + if (tb.Table == table) { page = tab; break; @@ -235,8 +259,7 @@ if (tbl == null) return; - frmDesignTable.EditColumns(Database, tbl); - + TabPage tab = GetTableTabPage(tbl); if (tab == null) @@ -247,7 +270,7 @@ if (ed == null) return; - ed.TableRefresh(); + ed.EditColumns(); DirtyState = true; } @@ -293,7 +316,7 @@ private void lstTables_MouseDown(object sender, MouseEventArgs e) { - + } private void lstTables_MouseUp(object sender, MouseEventArgs e) { @@ -377,7 +400,7 @@ AgateTable table = obj as AgateTable; if (MessageBox.Show(this, - "Really delete table " + table.Name + "?" + Environment.NewLine + Environment.NewLine + + "Really delete table " + table.Name + "?" + Environment.NewLine + Environment.NewLine + "This operation cannot be undone.", "Delete Table?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) @@ -437,7 +460,47 @@ } + TableEditor CurrentTable + { + get + { + if (tabs.TabPages.Count == 0) + return null; + return tabs.SelectedTab.Controls[0] as TableEditor; + } + } + + + internal void DesignCurrentTable() + { + if (CurrentTable == null) + return; + + CurrentTable.EditColumns(); + DirtyState = true; + + throw new NotImplementedException(); + } + + internal void CurrentTableSortAscending() + { + if (CurrentTable == null) + return; + + CurrentTable.SortAscending(); + DirtyState = true; + + } + + internal void CurrentTableSortDescending() + { + if (CurrentTable == null) + return; + + CurrentTable.SortDescending(); + DirtyState = true; + } } delegate void InvokeDelegate(); Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.csproj =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2010-01-31 08:10:27 UTC (rev 1220) @@ -186,6 +186,9 @@ <ItemGroup> <None Include="Resources\infoBubble.png" /> </ItemGroup> + <ItemGroup> + <None Include="Resources\NewDocumentHS.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2010-01-31 08:10:27 UTC (rev 1220) @@ -74,6 +74,13 @@ } } + internal static System.Drawing.Bitmap NewDocumentHS { + get { + object obj = ResourceManager.GetObject("NewDocumentHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap warning { get { object obj = ResourceManager.GetObject("warning", resourceCulture); Modified: trunk/Tools/DatabaseEditor/Properties/Resources.resx =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Resources.resx 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/Properties/Resources.resx 2010-01-31 08:10:27 UTC (rev 1220) @@ -121,10 +121,13 @@ <data name="Error" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\Error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="infoBubble" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\infoBubble.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> - <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + <data name="NewDocumentHS" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\NewDocumentHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> </root> \ No newline at end of file Added: trunk/Tools/DatabaseEditor/Resources/NewDocumentHS.png =================================================================== (Binary files differ) Property changes on: trunk/Tools/DatabaseEditor/Resources/NewDocumentHS.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/Tools/DatabaseEditor/TableEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.Designer.cs 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/TableEditor.Designer.cs 2010-01-31 08:10:27 UTC (rev 1220) @@ -44,7 +44,7 @@ this.gridView.Dock = System.Windows.Forms.DockStyle.Fill; this.gridView.Location = new System.Drawing.Point(0, 0); this.gridView.Name = "gridView"; - this.gridView.Size = new System.Drawing.Size(150, 150); + this.gridView.Size = new System.Drawing.Size(322, 255); this.gridView.TabIndex = 8; this.gridView.VirtualMode = true; this.gridView.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.gridView_UserDeletingRow); @@ -78,6 +78,8 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.gridView); this.Name = "TableEditor"; + this.Size = new System.Drawing.Size(322, 255); + this.Load += new System.EventHandler(this.TableEditor_Load); ((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit(); this.contextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); Modified: trunk/Tools/DatabaseEditor/TableEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-31 08:10:27 UTC (rev 1220) @@ -28,10 +28,10 @@ set { mDatabase = value; - AgateTable = null; + Table = null; } } - public AgateTable AgateTable + public AgateTable Table { get { return mTable; } set @@ -297,8 +297,54 @@ OnSetDirtyFlag(); } + private void TableEditor_Load(object sender, EventArgs e) + { + } + + + public void EditColumns() + { + frmDesignTable.EditColumns(Database, Table); + + TableRefresh(); + + OnSetDirtyFlag(); + } + + internal void SortAscending() + { + if (CurrentColumn == null) + return; + + Table.Rows.SortAscending(CurrentColumn); + gridView.Invalidate(); + + OnSetDirtyFlag(); + } + + internal void SortDescending() + { + if (CurrentColumn == null) + return; + + Table.Rows.SortDescending(CurrentColumn); + gridView.Invalidate(); + + OnSetDirtyFlag(); + } + + AgateColumn CurrentColumn + { + get + { + if (gridView.CurrentCell.ColumnIndex > -1) + return Table.Columns[gridView.CurrentCell.ColumnIndex]; + + return null; + } + } } public class StatusTextEventArgs : EventArgs Modified: trunk/Tools/DatabaseEditor/frmDesignTable.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmDesignTable.cs 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/frmDesignTable.cs 2010-01-31 08:10:27 UTC (rev 1220) @@ -237,7 +237,7 @@ else { chkPrimaryKey.Enabled = true; - chkPrimaryKey.Checked = colProperties.IsPrimaryKey; + chkPrimaryKey.Checked = colProperties.PrimaryKey; } } @@ -296,7 +296,7 @@ if (col == null) return; - col.IsPrimaryKey = chkPrimaryKey.Checked; + col.PrimaryKey = chkPrimaryKey.Checked; } } } Modified: trunk/Tools/DatabaseEditor/frmEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-31 08:10:27 UTC (rev 1220) @@ -28,6 +28,7 @@ /// </summary> private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmEditor)); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); @@ -44,16 +45,34 @@ this.generateCodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openDatabase = new System.Windows.Forms.OpenFileDialog(); this.saveDatabase = new System.Windows.Forms.SaveFileDialog(); + this.mainToolStrip = new System.Windows.Forms.ToolStrip(); + this.btnNew = new System.Windows.Forms.ToolStripButton(); + this.btnOpen = new System.Windows.Forms.ToolStripButton(); + this.btnSave = new System.Windows.Forms.ToolStripButton(); + this.toolStripContainer2 = new System.Windows.Forms.ToolStripContainer(); this.databaseEditor1 = new AgateDatabaseEditor.DatabaseEditor(); + this.tableToolStrip = new System.Windows.Forms.ToolStrip(); + this.btnDesignTable = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); + this.btnSortAscending = new System.Windows.Forms.ToolStripButton(); + this.btnSortDescending = new System.Windows.Forms.ToolStripButton(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); + this.mainToolStrip.SuspendLayout(); + this.toolStripContainer2.BottomToolStripPanel.SuspendLayout(); + this.toolStripContainer2.ContentPanel.SuspendLayout(); + this.toolStripContainer2.TopToolStripPanel.SuspendLayout(); + this.toolStripContainer2.SuspendLayout(); + this.tableToolStrip.SuspendLayout(); this.SuspendLayout(); // // statusStrip1 // + this.statusStrip1.Dock = System.Windows.Forms.DockStyle.None; this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.statusLabel}); - this.statusStrip1.Location = new System.Drawing.Point(0, 529); + this.statusStrip1.Location = new System.Drawing.Point(0, 0); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(632, 22); this.statusStrip1.TabIndex = 0; @@ -67,6 +86,7 @@ // // menuStrip1 // + this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.toolsToolStripMenuItem}); @@ -167,27 +187,150 @@ this.saveDatabase.DefaultExt = "adb"; this.saveDatabase.Filter = "Agate Database (*.adb)|*.adb|All files|*.*"; // + // mainToolStrip + // + this.mainToolStrip.Dock = System.Windows.Forms.DockStyle.None; + this.mainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.btnNew, + this.btnOpen, + this.btnSave}); + this.mainToolStrip.Location = new System.Drawing.Point(3, 24); + this.mainToolStrip.Name = "mainToolStrip"; + this.mainToolStrip.Size = new System.Drawing.Size(81, 25); + this.mainToolStrip.TabIndex = 4; + this.mainToolStrip.Text = "toolStrip1"; + // + // btnNew + // + this.btnNew.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnNew.Image = global::AgateDatabaseEditor.Properties.Resources.NewDocumentHS; + this.btnNew.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnNew.Name = "btnNew"; + this.btnNew.Size = new System.Drawing.Size(23, 22); + this.btnNew.Text = "toolStripButton1"; + this.btnNew.Click += new System.EventHandler(this.btnNew_Click); + // + // btnOpen + // + this.btnOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnOpen.Image = ((System.Drawing.Image)(resources.GetObject("btnOpen.Image"))); + this.btnOpen.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnOpen.Name = "btnOpen"; + this.btnOpen.Size = new System.Drawing.Size(23, 22); + this.btnOpen.Text = "toolStripButton2"; + this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click); + // + // btnSave + // + this.btnSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image"))); + this.btnSave.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(23, 22); + this.btnSave.Text = "toolStripButton3"; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // toolStripContainer2 + // + // + // toolStripContainer2.BottomToolStripPanel + // + this.toolStripContainer2.BottomToolStripPanel.Controls.Add(this.statusStrip1); + // + // toolStripContainer2.ContentPanel + // + this.toolStripContainer2.ContentPanel.Controls.Add(this.databaseEditor1); + this.toolStripContainer2.ContentPanel.Size = new System.Drawing.Size(632, 480); + this.toolStripContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.toolStripContainer2.Location = new System.Drawing.Point(0, 0); + this.toolStripContainer2.Name = "toolStripContainer2"; + this.toolStripContainer2.Size = new System.Drawing.Size(632, 551); + this.toolStripContainer2.TabIndex = 6; + this.toolStripContainer2.Text = "toolStripContainer2"; + // + // toolStripContainer2.TopToolStripPanel + // + this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.menuStrip1); + this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.mainToolStrip); + this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.tableToolStrip); + // // databaseEditor1 // this.databaseEditor1.Database = null; this.databaseEditor1.DirtyState = false; this.databaseEditor1.Dock = System.Windows.Forms.DockStyle.Fill; - this.databaseEditor1.Location = new System.Drawing.Point(0, 24); + this.databaseEditor1.Location = new System.Drawing.Point(0, 0); this.databaseEditor1.Name = "databaseEditor1"; - this.databaseEditor1.Size = new System.Drawing.Size(632, 505); + this.databaseEditor1.Size = new System.Drawing.Size(632, 480); this.databaseEditor1.TabIndex = 3; this.databaseEditor1.Visible = false; this.databaseEditor1.DirtyStateChanged += new System.EventHandler(this.databaseEditor1_DirtyStateChanged); this.databaseEditor1.StatusText += new System.EventHandler<AgateDatabaseEditor.StatusTextEventArgs>(this.databaseEditor1_StatusText); + this.databaseEditor1.TableActiveStatusChanged += new System.EventHandler(this.databaseEditor1_TableActiveStatusChanged); // + // tableToolStrip + // + this.tableToolStrip.Dock = System.Windows.Forms.DockStyle.None; + this.tableToolStrip.Enabled = false; + this.tableToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.btnDesignTable, + this.toolStripSeparator3, + this.toolStripLabel1, + this.btnSortAscending, + this.btnSortDescending}); + this.tableToolStrip.Location = new System.Drawing.Point(84, 24); + this.tableToolStrip.Name = "tableToolStrip"; + this.tableToolStrip.Size = new System.Drawing.Size(208, 25); + this.tableToolStrip.TabIndex = 10; + this.tableToolStrip.Text = "toolStrip1"; + // + // btnDesignTable + // + this.btnDesignTable.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.btnDesignTable.Image = ((System.Drawing.Image)(resources.GetObject("btnDesignTable.Image"))); + this.btnDesignTable.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnDesignTable.Name = "btnDesignTable"; + this.btnDesignTable.Size = new System.Drawing.Size(82, 22); + this.btnDesignTable.Text = "Edit Columns"; + this.btnDesignTable.Click += new System.EventHandler(this.btnDesignTable_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); + // + // toolStripLabel1 + // + this.toolStripLabel1.Name = "toolStripLabel1"; + this.toolStripLabel1.Size = new System.Drawing.Size(31, 22); + this.toolStripLabel1.Text = "Sort:"; + // + // btnSortAscending + // + this.btnSortAscending.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnSortAscending.Image = ((System.Drawing.Image)(resources.GetObject("btnSortAscending.Image"))); + this.btnSortAscending.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnSortAscending.Name = "btnSortAscending"; + this.btnSortAscending.Size = new System.Drawing.Size(23, 22); + this.btnSortAscending.Text = "toolStripButton1"; + this.btnSortAscending.Click += new System.EventHandler(this.btnSortAscending_Click); + // + // btnSortDescending + // + this.btnSortDescending.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnSortDescending.Image = ((System.Drawing.Image)(resources.GetObject("btnSortDescending.Image"))); + this.btnSortDescending.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnSortDescending.Name = "btnSortDescending"; + this.btnSortDescending.Size = new System.Drawing.Size(23, 22); + this.btnSortDescending.Text = "toolStripButton1"; + this.btnSortDescending.Click += new System.EventHandler(this.btnSortDescending_Click); + // // frmEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(632, 551); - this.Controls.Add(this.databaseEditor1); - this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.menuStrip1); + this.Controls.Add(this.toolStripContainer2); this.MainMenuStrip = this.menuStrip1; this.Name = "frmEditor"; this.Text = "Agate Database Editor"; @@ -196,8 +339,18 @@ this.statusStrip1.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); + this.mainToolStrip.ResumeLayout(false); + this.mainToolStrip.PerformLayout(); + this.toolStripContainer2.BottomToolStripPanel.ResumeLayout(false); + this.toolStripContainer2.BottomToolStripPanel.PerformLayout(); + this.toolStripContainer2.ContentPanel.ResumeLayout(false); + this.toolStripContainer2.TopToolStripPanel.ResumeLayout(false); + this.toolStripContainer2.TopToolStripPanel.PerformLayout(); + this.toolStripContainer2.ResumeLayout(false); + this.toolStripContainer2.PerformLayout(); + this.tableToolStrip.ResumeLayout(false); + this.tableToolStrip.PerformLayout(); this.ResumeLayout(false); - this.PerformLayout(); } @@ -220,6 +373,17 @@ private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripStatusLabel statusLabel; + private System.Windows.Forms.ToolStrip mainToolStrip; + private System.Windows.Forms.ToolStripButton btnNew; + private System.Windows.Forms.ToolStripButton btnOpen; + private System.Windows.Forms.ToolStripButton btnSave; + private System.Windows.Forms.ToolStripContainer toolStripContainer2; + private System.Windows.Forms.ToolStrip tableToolStrip; + private System.Windows.Forms.ToolStripButton btnDesignTable; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripLabel toolStripLabel1; + private System.Windows.Forms.ToolStripButton btnSortAscending; + private System.Windows.Forms.ToolStripButton btnSortDescending; } } Modified: trunk/Tools/DatabaseEditor/frmEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-31 08:10:27 UTC (rev 1220) @@ -24,22 +24,20 @@ title = Text; } - private void openDatabaseToolStripMenuItem_Click(object sender, EventArgs e) + #region --- Form Events --- + + private void frmEditor_FormClosing(object sender, FormClosingEventArgs e) { if (CheckSave() == false) - return; - if (openDatabase.ShowDialog() == DialogResult.Cancel) - return; + e.Cancel = true; - databaseEditor1.Visible = true; - databaseEditor1.Database = AgateLib.Data.AgateDatabase.FromFile(openDatabase.FileName); + } - filename = openDatabase.FileName; + #endregion - Text = System.IO.Path.GetFileName(filename) + " - " + title; - } + #region --- Basic database operations --- - private void newDatabaseToolStripMenuItem_Click(object sender, EventArgs e) + private void NewDatabase() { if (CheckSave() == false) return; @@ -49,7 +47,23 @@ Text = "New Database - " + title; } + + private void OpenDatabase() + { + if (CheckSave() == false) + return; + if (openDatabase.ShowDialog() == DialogResult.Cancel) + return; + databaseEditor1.Visible = true; + databaseEditor1.Database = AgateLib.Data.AgateDatabase.FromFile(openDatabase.FileName); + + filename = openDatabase.FileName; + + Text = System.IO.Path.GetFileName(filename) + " - " + title; + } + + /// <summary> /// Asks the user if they want to save before continuing the next operation. /// Returns false if the next operation should be canceled. @@ -126,16 +140,26 @@ return false; } + #endregion + #region --- Toolstrip Menu Items --- + + private void newDatabaseToolStripMenuItem_Click(object sender, EventArgs e) + { + NewDatabase(); + } + private void openDatabaseToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenDatabase(); + } + private void saveDatabaseToolStripMenuItem_Click(object sender, EventArgs e) { Save(); } - private void saveDatabaseAsToolStripMenuItem_Click(object sender, EventArgs e) { SaveAs(); } - private void generateCodeToolStripMenuItem_Click(object sender, EventArgs e) { frmCodeGenerator frm = new frmCodeGenerator(); @@ -156,7 +180,56 @@ databaseEditor1.DirtyState = true; } + private void importDataToolStripMenuItem_Click(object sender, EventArgs e) + { + frmImportTable import = new frmImportTable(); + import.Database = databaseEditor1.Database; + + if (import.ShowDialog() == DialogResult.OK) + { + databaseEditor1.DatabaseRefresh(); + } + } + private void quitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + #endregion + #region --- Tool strip button events --- + + private void btnNew_Click(object sender, EventArgs e) + { + NewDatabase(); + } + private void btnOpen_Click(object sender, EventArgs e) + { + OpenDatabase(); + } + private void btnSave_Click(object sender, EventArgs e) + { + Save(); + } + + + private void btnDesignTable_Click(object sender, EventArgs e) + { + databaseEditor1.DesignCurrentTable(); + } + private void btnSortAscending_Click(object sender, EventArgs e) + { + databaseEditor1.CurrentTableSortAscending(); + } + private void btnSortDescending_Click(object sender, EventArgs e) + { + databaseEditor1.CurrentTableSortDescending(); + } + + #endregion + + #region --- Code generation --- + private void GenerateCode(Type type, string directory, string theNamespace) { GenerateCode((System.CodeDom.Compiler.CodeDomProvider) @@ -174,23 +247,31 @@ } - private void importDataToolStripMenuItem_Click(object sender, EventArgs e) - { - frmImportTable import = new frmImportTable(); + #endregion - import.Database = databaseEditor1.Database; + #region --- Database editor events --- - if (import.ShowDialog() == DialogResult.OK) + private void databaseEditor1_TableActiveStatusChanged(object sender, EventArgs e) + { + tableToolStrip.Enabled = databaseEditor1.IsTableActive; + } + private void databaseEditor1_DirtyStateChanged(object sender, EventArgs e) + { + if (databaseEditor1.DirtyState) { - databaseEditor1.DatabaseRefresh(); + if (this.Text.StartsWith("* ") == false) + { + this.Text = "* " + this.Text; + } } + else + { + if (this.Text.StartsWith("* ") == true) + { + this.Text = this.Text.Substring(2); + } + } } - - private void quitToolStripMenuItem_Click(object sender, EventArgs e) - { - Close(); - } - private void databaseEditor1_StatusText(object sender, StatusTextEventArgs e) { switch (e.StatusTextIcon) @@ -211,29 +292,8 @@ statusLabel.Text = e.Text; } - private void frmEditor_FormClosing(object sender, FormClosingEventArgs e) - { - if (CheckSave() == false) - e.Cancel = true; + #endregion - } - private void databaseEditor1_DirtyStateChanged(object sender, EventArgs e) - { - if (databaseEditor1.DirtyState) - { - if (this.Text.StartsWith("* ") == false) - { - this.Text = "* " + this.Text; - } - } - else - { - if (this.Text.StartsWith("* ") == true) - { - this.Text = this.Text.Substring(2); - } - } - } } } Modified: trunk/Tools/DatabaseEditor/frmEditor.resx =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.resx 2010-01-31 08:09:51 UTC (rev 1219) +++ trunk/Tools/DatabaseEditor/frmEditor.resx 2010-01-31 08:10:27 UTC (rev 1220) @@ -129,4 +129,84 @@ <metadata name="saveDatabase.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>413, 27</value> </metadata> + <metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>539, 27</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="btnOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJzSURBVDhPvZNJSBRgGIbn0KFLFpmRCEmWiAWDgSHVQcSI + cqVcQckFy40yQzHHpRnX0dncpnTQZlwadbSyFMMKoVAkQsuFElOzoKgUU0Mlt6dxBMmyg5d+eC8/3/t8 + 7/cvAsH/WNkl1a6SQj3X8yrJVRtIkelSt9Q3NEGNT7QieNV0ObnCIsMIS8zS+oUklCBorFEFGMWfaq3L + VfyrS7So1NM3VoF3dIEJwFCfjvmpBpN+TupZHNdiqFTQVJOZsRnEJ0aJd1QhHpHFCBqqlMxN1m4wL38p + ZXEgntrbeVSX5aAtyUBTkM4tuYhiaRIboHU6GXPfdOudV4xmhkQwELmp/gLcKZfy47PGFHvV3NYoM+mR + IZ9mvZT71TkYtJnoNRIq1TeoKEylTClCLUteS1OtyWHmQxGrsUc7xDTVKlkelcBY1ka9N+6NpMBgAryJ + pbfen7gwryqBVp3J9HAefJTzoE5B12P5WtHvI7wOgW5fljrdmX/iwrsqIREXnKevRngeEZQXivn+VsJY + ZxpNejkrI2Loj1oD9IYbjYEsdXkx336amdaTTDQeRRJtS6CreYHpMEuVaUz0JXO3RkbPc2OSwXgj4CL0 + BLPy4hwLz84y2+bMZJMjX+vs6c7eRZC7DY52O+xMAHW+iP72dO7V5MNwOrwyxn3px0KHB7NPXZhqdmLc + IOST7hADcnPEkQdxOGzZsn6VRblJNFTmMfAwhm6VYF1d8m20S7fTkrGT+lQLtElW3LxmTZDbgRUnB2u3 + dYAqKxGV+BK5yaGkXAkgLtyLMP9TnD9zHNcTQo4JbbG3sWK/5R727jZjn7nZxoe0pV+1SfEv1Trk/R1X + IaIAAAAASUVORK5CYII= +</value> + </data> + <data name="btnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAItSURBVDhPrZPdS5NxFMf9F7zvJvCi25oaw7VYDZ5yDmXZ + MKyIUp/wNU2X+UKKpWnU8gWyFS6dtFpNwklFvoApYiKLpWhl5oqmOHxFJ4LBt9/5Rc8v07rJH5zLz+c8 + 55zvExa2E+/F8xCoPO0raHMv45FzAS3NQdyzzaCh/hust/y4XjWJ8rKPKC4aQ0H+CC7k+KD0JrCnG6iv + W8e/3tr6BgxJPTiR9IyXInA/XeKCmurFv/IEBxfWcND0EiqVDPNxlxA4H85zQXnZ9LaCX/DnwBIijR4U + XZ7CMVOrENibZrngkuXTFsHv8LuJIPZIbuTljiMh3i4EjXcCXJCdNbJJ8Cc84Atgl84JWR6G0WgTgrra + r1wgpw0rgu3g7qEvCI9pxslTrxEb2yAEN2qm0NUJdkrgzLk3MJ/u59umhdHM9NnU+Sfci0TzK0iSVQiu + VkygwwOWAaDV8Z3dfRVVlXN8qbQwmjkzw6fAcQnt0OurhaCkeByux8AD+wYLTgiG5NxNZTprQXJ6Ke8c + F8/goy7odBVCYCkYZTBQezvEO5OAhQSRGgneD7MYnZyDnH8Nhw1tHNYcckCrLRUCiqXtLpTPJgHB5wtv + 4r1/Hv6ZZVy8YkWUzsHgFkQduA9NTKEQZGa8ZXOv8Jkj9C7s3ifhSUcfPJ0D6OodQv+gF0eMZqi0TYhm + 8F51I9TqPCHISvcmpqb08XhSwigkdGc6FW2bFkYzU1cqgvdHZwvB//zRPwBCVjq+3Cul5wAAAABJRU5E + rkJggg== +</value> + </data> + <metadata name="tableToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>667, 27</value> + </metadata> + <data name="btnDesignTable.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI + ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9 + HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN + rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K + TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx + oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8 + 7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI + xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX + LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd + KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC +</value> + </data> + <data name="btnSortAscending.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF8SURBVDhPY2CAAq/6kxIOBfu/WsYsEoOJ4aD/YxX3LDq4 + yjV7+3+r8GmlZBnglrv1nn3iuofGwT0vSTbAteCgk2v2+u+W8fM1jAM6/1tGzgzAYwimF1wzt592TF53 + yyxs0jSTwOYv5iGTDhJtQGjoKmb7lO0f7bO2SIA0WUTO8DX27/hvFj1di6hAdMnceswstPOHRdjkFGOf + mVzG7u3vQQYY+7dfJMoAAgGGTRozDCZH5K2dHJq+c3pk4dypUQW7Jrp6Xewx0kgh2gWT3QO3gRTPjkgW + n+rh8aJWS+ke0YEIUjjN1RWc+mYGxs6s01f9X6+vFobFgEagmDcQg7zgCsRdKGrmhGc5T3L3/V+np7oK + h+3GUM0gA0DYCUXd1Oj8B12Gai9azXXEQRJTHB21sRi0Bar5GIrctLCs3n57u/8dRhqpIImJHjainYYa + S7EYAHMFwvYp7r7aDcZKX4rUlL7W6qnMbjJQWVGsJfeqWld5Lg6vVJMR9bi1AACSWoZyM6QFpAAAAABJ + RU5ErkJggg== +</value> + </data> + <data name="btnSortDescending.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFNSURBVDhPY/gPBf7Vp/57FOz/b5WwGCaElWZgYEARh/M8 + iw7+d83e/t8qYjpOA0CaYRimCG6AW+7O/85p6/8bB/eQboB7wQGw7Taxc/8bB3T+t4qcgWEIsu3IrgC7 + AKTZKXXdf7OwSf9Ngrr/m4dNJt4AkGbXLCAG0iBgGTXzv7F/x3/zqGnEBaJL1rb/5qET/1uGT/5vFTYD + qLkTbICxfztxBuCNMyySWKNxakT+/6mhmf+nRxf9nxpV8H+iu+//HmNN4l0w2TMQrHh2ZMr/qZ4+/2v1 + VPFGJbIkOBamu7mBxWYGxf+v01f936CvTpoBINVzIrL/TwI6vU5fjbykPBXo/y4Tzf+t5jpgA6Y4OhIf + BjPCs//329v97zDSAGua5Gn7v8sYwkYHGLEwBejsDmCIl+soAQNP7X+zodr/Sl2V/9VATJQBpKYDdPUA + zlk0RkYj9MEAAAAASUVORK5CYII= +</value> + </data> </root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-31 08:09:57
|
Revision: 1219 http://agate.svn.sourceforge.net/agate/?rev=1219&view=rev Author: kanato Date: 2010-01-31 08:09:51 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Implement sorting of rows. Rename IsPrimaryKey to PrimaryKey. Modified Paths: -------------- trunk/AgateLib/Data/AgateColumn.cs trunk/AgateLib/Data/AgateColumnDictionary.cs trunk/AgateLib/Data/AgateRow.cs trunk/AgateLib/Data/AgateRowList.cs Modified: trunk/AgateLib/Data/AgateColumn.cs =================================================================== --- trunk/AgateLib/Data/AgateColumn.cs 2010-01-30 19:54:57 UTC (rev 1218) +++ trunk/AgateLib/Data/AgateColumn.cs 2010-01-31 08:09:51 UTC (rev 1219) @@ -120,7 +120,7 @@ return AgateDataHelper.FromFieldType(FieldType); } } - public bool IsPrimaryKey + public bool PrimaryKey { get { return mPrimaryKey; } set { mPrimaryKey = value; } @@ -141,6 +141,29 @@ set { mDescription = value; } } + public bool IsNumeric + { + get + { + switch (FieldType) + { + case FieldType.AutoNumber: + case FieldType.Byte: + case FieldType.Decimal: + case FieldType.Double: + case FieldType.Int16: + case FieldType.Int32: + case FieldType.SByte: + case FieldType.Single: + case FieldType.UInt16: + case FieldType.UInt32: + return true; + + default: + return false; + } + } + } #endregion public override string ToString() Modified: trunk/AgateLib/Data/AgateColumnDictionary.cs =================================================================== --- trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-01-30 19:54:57 UTC (rev 1218) +++ trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-01-31 08:09:51 UTC (rev 1219) @@ -75,7 +75,7 @@ { get { - return mColumns.FirstOrDefault(x => x.IsPrimaryKey); + return mColumns.FirstOrDefault(x => x.PrimaryKey); } } Modified: trunk/AgateLib/Data/AgateRow.cs =================================================================== --- trunk/AgateLib/Data/AgateRow.cs 2010-01-30 19:54:57 UTC (rev 1218) +++ trunk/AgateLib/Data/AgateRow.cs 2010-01-31 08:09:51 UTC (rev 1219) @@ -125,7 +125,7 @@ values.Add(column.Name, null); } - if (column.IsPrimaryKey) + if (column.PrimaryKey) { var matches = from x in agateTable.Rows where x != null && x[column] == this[column] Modified: trunk/AgateLib/Data/AgateRowList.cs =================================================================== --- trunk/AgateLib/Data/AgateRowList.cs 2010-01-30 19:54:57 UTC (rev 1218) +++ trunk/AgateLib/Data/AgateRowList.cs 2010-01-31 08:09:51 UTC (rev 1219) @@ -33,6 +33,28 @@ { mRows.ForEach(action); } + public void SortDescending(AgateColumn col) + { + if (col.IsNumeric) + { + mRows.Sort((x, y) => -decimal.Parse(x[col]).CompareTo(decimal.Parse(y[col]))); + } + else + { + mRows.Sort((x, y) => -x[col].CompareTo(y[col])); + } + } + public void SortAscending(AgateColumn col) + { + if (col.IsNumeric) + { + mRows.Sort((x, y) => decimal.Parse(x[col]).CompareTo(decimal.Parse(y[col]))); + } + else + { + mRows.Sort((x, y) => x[col].CompareTo(y[col])); + } + } public override string ToString() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-30 19:55:04
|
Revision: 1218 http://agate.svn.sourceforge.net/agate/?rev=1218&view=rev Author: kanato Date: 2010-01-30 19:54:57 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Lots of UI enhancements: * Save dialog on exiting * Dirty state noted in title bar * Editing columns easier * More consistent behavior in DatabaseEditor. * Lookup fields implemented. Modified Paths: -------------- trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs trunk/Tools/DatabaseEditor/DatabaseEditor.cs trunk/Tools/DatabaseEditor/DatabaseEditor.csproj trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs trunk/Tools/DatabaseEditor/Properties/Resources.resx trunk/Tools/DatabaseEditor/TableEditor.Designer.cs trunk/Tools/DatabaseEditor/TableEditor.cs trunk/Tools/DatabaseEditor/frmDesignTable.Designer.cs trunk/Tools/DatabaseEditor/frmDesignTable.cs trunk/Tools/DatabaseEditor/frmDesignTable.resx trunk/Tools/DatabaseEditor/frmEditor.Designer.cs trunk/Tools/DatabaseEditor/frmEditor.cs Added Paths: ----------- trunk/Tools/DatabaseEditor/Resources/Error.png trunk/Tools/DatabaseEditor/Resources/infoBubble.png trunk/Tools/DatabaseEditor/Resources/warning.png Removed Paths: ------------- trunk/Tools/DatabaseEditor/Resources/warning1.png Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -46,6 +46,10 @@ this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.duplicateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.editColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabContextMenu.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -172,17 +176,21 @@ // tableContextMenu // this.tableContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openToolStripMenuItem, + this.editColumnsToolStripMenuItem, + this.toolStripSeparator1, this.renameToolStripMenuItem, this.duplicateToolStripMenuItem, + this.toolStripSeparator2, this.deleteToolStripMenuItem}); this.tableContextMenu.Name = "tableContextMenu"; - this.tableContextMenu.Size = new System.Drawing.Size(153, 92); + this.tableContextMenu.Size = new System.Drawing.Size(155, 148); // // renameToolStripMenuItem // this.renameToolStripMenuItem.Name = "renameToolStripMenuItem"; - this.renameToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.renameToolStripMenuItem.Text = "Rename..."; + this.renameToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.renameToolStripMenuItem.Text = "Rename"; this.renameToolStripMenuItem.Click += new System.EventHandler(this.renameToolStripMenuItem_Click); // // duplicateToolStripMenuItem @@ -199,6 +207,31 @@ this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem.Text = "Open"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6); + // + // editColumnsToolStripMenuItem + // + this.editColumnsToolStripMenuItem.Name = "editColumnsToolStripMenuItem"; + this.editColumnsToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.editColumnsToolStripMenuItem.Text = "Edit Columns..."; + this.editColumnsToolStripMenuItem.Click += new System.EventHandler(this.editColumnsToolStripMenuItem_Click); + // // DatabaseEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -234,5 +267,9 @@ private System.Windows.Forms.ContextMenuStrip tabContextMenu; private System.Windows.Forms.ToolStripMenuItem closeTabToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem duplicateToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem editColumnsToolStripMenuItem; } } Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -13,6 +13,7 @@ public partial class DatabaseEditor : UserControl { AgateDatabase mDatabase; + bool mDirtyState; public DatabaseEditor() { @@ -90,10 +91,14 @@ private void lstTables_DoubleClick(object sender, EventArgs e) { + openToolStripMenuItem_Click(sender, e); + } + private void openToolStripMenuItem_Click(object sender, EventArgs e) + { if (lstTables.SelectedItems.Count == 0) return; - object obj = lstTables.SelectedItems[0].Tag ; + object obj = lstTables.SelectedItems[0].Tag; AgateTable table = obj as AgateTable; InvokeDelegate method = obj as InvokeDelegate; @@ -109,41 +114,144 @@ private void OpenTableTab(AgateTable table) { + TabPage page = GetTableTabPage(table); + + if (page == null) + { + TableEditor editor = new TableEditor(); + editor.Database = Database; + editor.AgateTable = table; + editor.Dock = DockStyle.Fill; + editor.StatusText += new EventHandler<StatusTextEventArgs>(editor_StatusText); + editor.SetDirtyFlag += new EventHandler(editor_SetDirtyFlag); + + page = new TabPage(table.Name); + page.Controls.Add(editor); + + tabs.TabPages.Add(page); + } + + tabs.SelectedTab = page; + } + + void editor_SetDirtyFlag(object sender, EventArgs e) + { + DirtyState = true; + } + void editor_StatusText(object sender, StatusTextEventArgs e) + { + OnStatusText(e); + } + + /// <summary> + /// Returns null if the tab page is not open. + /// </summary> + /// <param name="table"></param> + /// <returns></returns> + private TabPage GetTableTabPage(AgateTable table) + { + TabPage page = null; + foreach (TabPage tab in tabs.TabPages) { Control ctrl = tab.Controls[0]; - + if (ctrl is TableEditor) { TableEditor tb = (TableEditor)ctrl; if (tb.AgateTable == table) { - tabs.SelectedTab = tab; - return; + page = tab; + break; } } } + return page; + } - TabPage page = new TabPage(table.Name); - - TableEditor editor = new TableEditor(); - editor.Database = Database; - editor.AgateTable = table; - editor.Dock = DockStyle.Fill; + public bool DirtyState + { + get { return mDirtyState; } + set + { + if (value == mDirtyState) + return; - page.Controls.Add(editor); + mDirtyState = value; + OnDirtyStateChanged(); + } + } - tabs.TabPages.Add(page); + private void OnDirtyStateChanged() + { + if (DirtyStateChanged != null) + DirtyStateChanged(this, EventArgs.Empty); + } - tabs.SelectedTab = page; + public event EventHandler DirtyStateChanged; + + private void OnStatusText(StatusTextIcon icon, string text) + { + OnStatusText(new StatusTextEventArgs(icon, text)); } + private void OnStatusText(StatusTextEventArgs e) + { + if (StatusText != null) + StatusText(this, e); + } + public event EventHandler<StatusTextEventArgs> StatusText; + + private void NewTable() { - MessageBox.Show("Creating new table"); + AgateTable tbl = new AgateTable(); + tbl.Name = "Table"; + + IncrementTableName(tbl); + + Database.Tables.Add(tbl); + + frmDesignTable.EditColumns(Database, tbl); + OpenTableTab(tbl); + + DatabaseRefresh(); + + DirtyState = true; } + private void editColumnsToolStripMenuItem_Click(object sender, EventArgs e) + { + AgateTable tbl = null; + + if (lstTables.SelectedItems.Count == 0) + return; + else if (lstTables.SelectedItems.Count == 1) + { + tbl = lstTables.SelectedItems[0].Tag as AgateTable; + } + + if (tbl == null) + return; + + frmDesignTable.EditColumns(Database, tbl); + + TabPage tab = GetTableTabPage(tbl); + + if (tab == null) + return; + + TableEditor ed = tab.Controls[0] as TableEditor; + + if (ed == null) + return; + + ed.TableRefresh(); + + DirtyState = true; + } + private void closeTabToolStripMenuItem_Click(object sender, EventArgs e) { TableEditor editor = tabs.SelectedTab.Controls[0] as TableEditor; @@ -156,6 +264,7 @@ tabs.TabPages.Remove(tabs.SelectedTab); } + private void largeIconsToolStripMenuItem_Click(object sender, EventArgs e) { lstTables.View = View.LargeIcon; @@ -164,7 +273,6 @@ largeIconsToolStripMenuItem.Checked = true; listToolStripMenuItem.Checked = false; } - private void smallIconsToolStripMenuItem_Click(object sender, EventArgs e) { lstTables.View = View.SmallIcon; @@ -187,7 +295,6 @@ { } - private void lstTables_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) @@ -228,12 +335,22 @@ object obj = lstTables.SelectedItems[0].Tag; AgateTable table = obj as AgateTable; + if (table == null) + return; + + TabPage page = GetTableTabPage(table); + if (Database.Tables.ContainsTable(e.Label)) { e.CancelEdit = true; } else + { table.Name = e.Label; + page.Text = table.Name; + } + + DirtyState = true; } private void lstTables_KeyDown(object sender, KeyEventArgs e) @@ -268,6 +385,8 @@ Database.Tables.Remove(table); DatabaseRefresh(); } + + DirtyState = true; } private void duplicateToolStripMenuItem_Click(object sender, EventArgs e) @@ -289,6 +408,8 @@ Database.Tables.Add(newTable); DatabaseRefresh(); + + DirtyState = true; } private static void IncrementTableName(AgateTable table) @@ -316,6 +437,7 @@ } + } delegate void InvokeDelegate(); Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.csproj =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2010-01-30 19:54:57 UTC (rev 1218) @@ -178,8 +178,14 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <None Include="Resources\warning1.png" /> + <None Include="Resources\warning.png" /> </ItemGroup> + <ItemGroup> + <None Include="Resources\Error.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\infoBubble.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -60,6 +60,20 @@ } } + internal static System.Drawing.Bitmap Error { + get { + object obj = ResourceManager.GetObject("Error", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap infoBubble { + get { + object obj = ResourceManager.GetObject("infoBubble", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap warning { get { object obj = ResourceManager.GetObject("warning", resourceCulture); Modified: trunk/Tools/DatabaseEditor/Properties/Resources.resx =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Resources.resx 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/Properties/Resources.resx 2010-01-30 19:54:57 UTC (rev 1218) @@ -118,7 +118,13 @@ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="Error" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\Error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="infoBubble" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\infoBubble.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>..\Resources\warning1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> </root> \ No newline at end of file Added: trunk/Tools/DatabaseEditor/Resources/Error.png =================================================================== (Binary files differ) Property changes on: trunk/Tools/DatabaseEditor/Resources/Error.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Tools/DatabaseEditor/Resources/infoBubble.png =================================================================== (Binary files differ) Property changes on: trunk/Tools/DatabaseEditor/Resources/infoBubble.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Copied: trunk/Tools/DatabaseEditor/Resources/warning.png (from rev 1213, trunk/Tools/DatabaseEditor/Resources/warning1.png) =================================================================== (Binary files differ) Deleted: trunk/Tools/DatabaseEditor/Resources/warning1.png =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseEditor/TableEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.Designer.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/TableEditor.Designer.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -53,6 +53,7 @@ this.gridView.RowValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridView_RowValidated); this.gridView.RowDirtyStateNeeded += new System.Windows.Forms.QuestionEventHandler(this.gridView_RowDirtyStateNeeded); this.gridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.gridView_CellValuePushed); + this.gridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.gridView_DataError); this.gridView.NewRowNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.gridView_NewRowNeeded); this.gridView.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.gridView_ColumnWidthChanged); this.gridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridView_CellContentClick); Modified: trunk/Tools/DatabaseEditor/TableEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/TableEditor.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -25,7 +25,9 @@ public AgateDatabase Database { get { return mDatabase; } - set { mDatabase = value; + set + { + mDatabase = value; AgateTable = null; } } @@ -35,7 +37,7 @@ set { mTable = value; - TableReset(); + TableRefresh(); } } @@ -44,12 +46,15 @@ gridView.CommitEdit(DataGridViewDataErrorContexts.Commit); gridView.EndEdit(); - DataGridViewCellEventArgs e = new DataGridViewCellEventArgs(gridView.CurrentCell.ColumnIndex, gridView.CurrentCell.RowIndex); + if (gridView.CurrentCell != null) + { + DataGridViewCellEventArgs e = new DataGridViewCellEventArgs(gridView.CurrentCell.ColumnIndex, gridView.CurrentCell.RowIndex); - gridView_RowValidated(gridView, e); + gridView_RowValidated(gridView, e); + } } - private void TableReset() + public void TableRefresh() { gridView.SuspendLayout(); gridView.Columns.Clear(); @@ -60,7 +65,7 @@ return; } - + int index = 0; foreach (var column in mTable.Columns) { @@ -69,11 +74,47 @@ col.Name = column.Name; col.ReadOnly = column.FieldType == FieldType.AutoNumber; - if (string.IsNullOrEmpty(column.TableLookup)) + if (column.FieldType == FieldType.Boolean) { + col.CellTemplate = new DataGridViewCheckBoxCell(); + } + else if (string.IsNullOrEmpty(column.TableLookup) || string.IsNullOrEmpty(column.TableDisplayField)) + { col.CellTemplate = new DataGridViewTextBoxCell(); } + else + { + var cbo = new DataGridViewComboBoxCell(); + var table = Database.Tables[column.TableLookup]; + if (table == null) + { + OnStatusText(StatusTextIcon.Warning, "The lookup table " + table.Name + " does not exist."); + + col.CellTemplate = new DataGridViewTextBoxCell(); + } + else + { + var primaryKey = table.Columns.PrimaryKeyColumn; + if (primaryKey != null) + { + for (int i = 0; i < table.Rows.Count; i++) + { + cbo.Items.Add(new { ID = table.Rows[i][primaryKey], Name = table.Rows[i][column.TableDisplayField] }); + } + cbo.DisplayMember = "Name"; + cbo.ValueMember = "ID"; + + col.CellTemplate = cbo; + } + else + { + OnStatusText(StatusTextIcon.Warning, "The lookup table " + table.Name + " needs a primary key field."); + col.CellTemplate = new DataGridViewTextBoxCell(); + } + } + } + if (column.ColumnWidth > 10) col.Width = column.ColumnWidth; @@ -86,6 +127,20 @@ gridView.ResumeLayout(); } + private void OnStatusText(StatusTextIcon icon, string text) + { + if (StatusText != null) + StatusText(this, new StatusTextEventArgs(icon, text)); + } + public event EventHandler<StatusTextEventArgs> StatusText; + + private void OnSetDirtyFlag() + { + if (SetDirtyFlag != null) + SetDirtyFlag(this, EventArgs.Empty); + } + public event EventHandler SetDirtyFlag; + private void UpdateGridViewRowCount() { gridView.RowCount = mTable.Rows.Count + 1; @@ -100,6 +155,10 @@ return GetColumn(columnIndex).Name; } + private void gridView_DataError(object sender, DataGridViewDataErrorEventArgs e) + { + // swallow unnecessary error? + } private void gridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) { if (e.RowIndex == gridView.RowCount - 1) @@ -110,9 +169,18 @@ if (e.RowIndex == mEditingRowIndex) row = mEditingRow; else - row = mTable.Rows[e.RowIndex]; + row = mTable.Rows[e.RowIndex]; - e.Value = row[ColumnName(e.ColumnIndex)]; + string value = row[ColumnName(e.ColumnIndex)]; + + if (mTable.Columns[e.ColumnIndex].FieldType == FieldType.Boolean) + { + e.Value = bool.Parse(value); + } + else + { + e.Value = value; + } } private void gridView_CellValuePushed(object sender, DataGridViewCellValueEventArgs e) { @@ -130,7 +198,7 @@ mEditingRowIndex = e.RowIndex; } - + row = this.mEditingRow; try @@ -144,6 +212,8 @@ "The field data type is " + mTable.Columns[e.ColumnIndex].FieldType.ToString() + ".", "Invalid data", MessageBoxButtons.OK, MessageBoxIcon.Warning); } + + OnSetDirtyFlag(); } private void gridView_NewRowNeeded(object sender, DataGridViewRowEventArgs e) { @@ -153,7 +223,7 @@ private void gridView_RowValidated(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= mTable.Rows.Count && - e.RowIndex != gridView.Rows.Count-1) + e.RowIndex != gridView.Rows.Count - 1) { mTable.Rows.Add(mEditingRow); mEditingRow = null; @@ -214,15 +284,39 @@ private void gridView_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e) { mTable.Columns[e.Column.Index].ColumnWidth = e.Column.Width; + + OnSetDirtyFlag(); } private void editColumnsToolStripMenuItem_Click(object sender, EventArgs e) { - frmDesignTable.EditColumns(mTable); + frmDesignTable.EditColumns(Database, mTable); - TableReset(); + TableRefresh(); + + OnSetDirtyFlag(); } + } + + public class StatusTextEventArgs : EventArgs + { + public string Text { get; private set; } + public StatusTextIcon StatusTextIcon { get; private set; } + + public StatusTextEventArgs(StatusTextIcon icon, string text) + { + StatusTextIcon = icon; + Text = text; + } + } + + public enum StatusTextIcon + { + Information, + Warning, + Error, + } } Modified: trunk/Tools/DatabaseEditor/frmDesignTable.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmDesignTable.Designer.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/frmDesignTable.Designer.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -35,7 +35,13 @@ this.groupBox1 = new System.Windows.Forms.GroupBox(); this.panel1 = new System.Windows.Forms.Panel(); this.btnOK = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.cboTableLookup = new System.Windows.Forms.ComboBox(); + this.cboDisplayField = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.chkPrimaryKey = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.gridColumns)).BeginInit(); + this.groupBox1.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); // @@ -53,6 +59,7 @@ this.gridColumns.TabIndex = 0; this.gridColumns.VirtualMode = true; this.gridColumns.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.gridColumns_UserDeletingRow); + this.gridColumns.RowEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridColumns_RowEnter); this.gridColumns.CancelRowEdit += new System.Windows.Forms.QuestionEventHandler(this.gridColumns_CancelRowEdit); this.gridColumns.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.gridColumns_CellValueNeeded); this.gridColumns.RowValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridColumns_RowValidated); @@ -81,6 +88,11 @@ this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.chkPrimaryKey); + this.groupBox1.Controls.Add(this.cboDisplayField); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.cboTableLookup); + this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new System.Drawing.Point(12, 6); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(741, 183); @@ -108,6 +120,59 @@ this.btnOK.Text = "OK"; this.btnOK.UseVisualStyleBackColor = true; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(59, 50); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(73, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Table Lookup"; + // + // cboTableLookup + // + this.cboTableLookup.DisplayMember = "Name"; + this.cboTableLookup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboTableLookup.FormattingEnabled = true; + this.cboTableLookup.Location = new System.Drawing.Point(138, 47); + this.cboTableLookup.Name = "cboTableLookup"; + this.cboTableLookup.Size = new System.Drawing.Size(189, 21); + this.cboTableLookup.TabIndex = 2; + this.cboTableLookup.SelectedIndexChanged += new System.EventHandler(this.cboTableLookup_SelectedIndexChanged); + // + // cboDisplayField + // + this.cboDisplayField.DisplayMember = "Name"; + this.cboDisplayField.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboDisplayField.Enabled = false; + this.cboDisplayField.FormattingEnabled = true; + this.cboDisplayField.Location = new System.Drawing.Point(138, 74); + this.cboDisplayField.Name = "cboDisplayField"; + this.cboDisplayField.Size = new System.Drawing.Size(189, 21); + this.cboDisplayField.TabIndex = 4; + this.cboDisplayField.SelectedIndexChanged += new System.EventHandler(this.cboDisplayField_SelectedIndexChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(27, 77); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(105, 13); + this.label2.TabIndex = 3; + this.label2.Text = "Lookup Display Field"; + // + // chkPrimaryKey + // + this.chkPrimaryKey.AutoSize = true; + this.chkPrimaryKey.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.chkPrimaryKey.Location = new System.Drawing.Point(72, 24); + this.chkPrimaryKey.Name = "chkPrimaryKey"; + this.chkPrimaryKey.Size = new System.Drawing.Size(81, 17); + this.chkPrimaryKey.TabIndex = 5; + this.chkPrimaryKey.Text = "Primary Key"; + this.chkPrimaryKey.UseVisualStyleBackColor = true; + this.chkPrimaryKey.CheckedChanged += new System.EventHandler(this.chkPrimaryKey_CheckedChanged); + // // frmDesignTable // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -122,6 +187,8 @@ this.ShowInTaskbar = false; this.Text = "Table Design"; ((System.ComponentModel.ISupportInitialize)(this.gridColumns)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); this.panel1.ResumeLayout(false); this.ResumeLayout(false); @@ -136,6 +203,11 @@ private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.ComboBox cboTableLookup; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cboDisplayField; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.CheckBox chkPrimaryKey; } } \ No newline at end of file Modified: trunk/Tools/DatabaseEditor/frmDesignTable.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmDesignTable.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/frmDesignTable.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -21,25 +21,47 @@ } } + AgateDatabase mDatabase; AgateTable mTable; AgateColumn mColumnInEdit; int mRowInEdit = -1; + public AgateDatabase TheDatabase + { + get { return mDatabase; } + set + { + mDatabase = value; + + cboTableLookup.Items.Clear(); + + cboTableLookup.Items.Add(new { Name = "(none)" }); + + foreach (var table in mDatabase.Tables) + { + cboTableLookup.Items.Add(table); + } + } + } public AgateTable TheTable { get { return mTable; } set { + if (mDatabase == null) + throw new ArgumentNullException("TheDatabase should be set first."); + mTable = value; gridColumns.RowCount = mTable.Columns.Count+1; } } - internal static void EditColumns(AgateLib.Data.AgateTable mTable) + internal static void EditColumns(AgateLib.Data.AgateDatabase dbase, AgateLib.Data.AgateTable mTable) { frmDesignTable d = new frmDesignTable(); + d.TheDatabase = dbase; d.TheTable = mTable; d.ShowDialog(); @@ -177,5 +199,104 @@ } } + + AgateColumn colProperties; + + private void gridColumns_RowEnter(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex < mTable.Columns.Count) + colProperties = mTable.Columns[e.RowIndex]; + else + { + colProperties = mColumnInEdit; + } + + if (colProperties == null) + { + cboTableLookup.Enabled = false; + cboDisplayField.Enabled = false; + } + else if (string.IsNullOrEmpty(colProperties.TableLookup)) + { + cboTableLookup.Enabled = true; + cboTableLookup.SelectedIndex = 0; + cboDisplayField.Enabled = false; + } + else + { + cboTableLookup.Enabled = true; + + AgateTable selTable = mDatabase.Tables[colProperties.TableLookup]; + + cboTableLookup.SelectedItem = selTable; + cboDisplayField.SelectedItem = selTable.Columns[colProperties.TableDisplayField]; + } + + if (colProperties == null) + chkPrimaryKey.Enabled = false; + else + { + chkPrimaryKey.Enabled = true; + chkPrimaryKey.Checked = colProperties.IsPrimaryKey; + } + } + + private void cboTableLookup_SelectedIndexChanged(object sender, EventArgs e) + { + AgateColumn col = colProperties; + if (col == null) + col = mColumnInEdit; + + if (col == null) + return; + + cboDisplayField.Items.Clear(); + + AgateTable table = cboTableLookup.SelectedItem as AgateTable; + if (table == null) + { + col.TableLookup = ""; + cboDisplayField.Enabled = false; + return; + } + + col.TableLookup = table.Name; + + foreach (var column in table.Columns) + { + cboDisplayField.Items.Add(column); + } + + cboDisplayField.Enabled = true; + } + + private void cboDisplayField_SelectedIndexChanged(object sender, EventArgs e) + { + AgateColumn col = colProperties; + if (col == null) + col = mColumnInEdit; + + if (col == null) + return; + + AgateColumn selectedField = cboDisplayField.SelectedItem as AgateColumn; + + if (selectedField == null) + col.TableDisplayField = ""; + else + col.TableDisplayField = selectedField.Name; + } + + private void chkPrimaryKey_CheckedChanged(object sender, EventArgs e) + { + AgateColumn col = colProperties; + if (col == null) + col = mColumnInEdit; + + if (col == null) + return; + + col.IsPrimaryKey = chkPrimaryKey.Checked; + } } } Modified: trunk/Tools/DatabaseEditor/frmDesignTable.resx =================================================================== --- trunk/Tools/DatabaseEditor/frmDesignTable.resx 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/frmDesignTable.resx 2010-01-30 19:54:57 UTC (rev 1218) @@ -126,4 +126,13 @@ <metadata name="colDescription.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="colName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="colDataType.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="colDescription.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> </root> \ No newline at end of file Modified: trunk/Tools/DatabaseEditor/frmEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/frmEditor.Designer.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -29,6 +29,7 @@ private void InitializeComponent() { this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -43,18 +44,27 @@ this.generateCodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openDatabase = new System.Windows.Forms.OpenFileDialog(); this.saveDatabase = new System.Windows.Forms.SaveFileDialog(); - this.databaseEditor1 = new DatabaseEditor(); + this.databaseEditor1 = new AgateDatabaseEditor.DatabaseEditor(); + this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // statusStrip1 // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.statusLabel}); this.statusStrip1.Location = new System.Drawing.Point(0, 529); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(632, 22); this.statusStrip1.TabIndex = 0; this.statusStrip1.Text = "statusStrip1"; // + // statusLabel + // + this.statusLabel.Name = "statusLabel"; + this.statusLabel.Size = new System.Drawing.Size(118, 17); + this.statusLabel.Text = "toolStripStatusLabel1"; + // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -160,12 +170,15 @@ // databaseEditor1 // this.databaseEditor1.Database = null; + this.databaseEditor1.DirtyState = false; this.databaseEditor1.Dock = System.Windows.Forms.DockStyle.Fill; this.databaseEditor1.Location = new System.Drawing.Point(0, 24); this.databaseEditor1.Name = "databaseEditor1"; this.databaseEditor1.Size = new System.Drawing.Size(632, 505); this.databaseEditor1.TabIndex = 3; this.databaseEditor1.Visible = false; + this.databaseEditor1.DirtyStateChanged += new System.EventHandler(this.databaseEditor1_DirtyStateChanged); + this.databaseEditor1.StatusText += new System.EventHandler<AgateDatabaseEditor.StatusTextEventArgs>(this.databaseEditor1_StatusText); // // frmEditor // @@ -178,6 +191,9 @@ this.MainMenuStrip = this.menuStrip1; this.Name = "frmEditor"; this.Text = "Agate Database Editor"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmEditor_FormClosing); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); @@ -203,6 +219,7 @@ private System.Windows.Forms.ToolStripMenuItem importDataToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripStatusLabel statusLabel; } } Modified: trunk/Tools/DatabaseEditor/frmEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-30 19:53:09 UTC (rev 1217) +++ trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-30 19:54:57 UTC (rev 1218) @@ -13,10 +13,15 @@ public partial class frmEditor : Form { string filename; + string title; public frmEditor() { InitializeComponent(); + + statusLabel.Text = ""; + + title = Text; } private void openDatabaseToolStripMenuItem_Click(object sender, EventArgs e) @@ -30,6 +35,8 @@ databaseEditor1.Database = AgateLib.Data.AgateDatabase.FromFile(openDatabase.FileName); filename = openDatabase.FileName; + + Text = System.IO.Path.GetFileName(filename) + " - " + title; } private void newDatabaseToolStripMenuItem_Click(object sender, EventArgs e) @@ -39,6 +46,8 @@ databaseEditor1.Visible = true; databaseEditor1.Database = new AgateLib.Data.AgateDatabase(); + + Text = "New Database - " + title; } /// <summary> @@ -50,6 +59,8 @@ { if (databaseEditor1.Database == null) return true; + if (databaseEditor1.DirtyState == false) + return true; string name = System.IO.Path.GetFileName(filename); @@ -120,7 +131,6 @@ Save(); } - private void saveDatabaseAsToolStripMenuItem_Click(object sender, EventArgs e) { SaveAs(); @@ -143,6 +153,8 @@ "Code Generation", MessageBoxButtons.OK, MessageBoxIcon.Information); } + + databaseEditor1.DirtyState = true; } private void GenerateCode(Type type, string directory, string theNamespace) @@ -178,5 +190,50 @@ { Close(); } + + private void databaseEditor1_StatusText(object sender, StatusTextEventArgs e) + { + switch (e.StatusTextIcon) + { + case StatusTextIcon.Information: + statusLabel.Image = Properties.Resources.infoBubble; + break; + + case StatusTextIcon.Warning: + statusLabel.Image = Properties.Resources.warning; + break; + + case StatusTextIcon.Error: + statusLabel.Image = Properties.Resources.Error; + break; + } + + statusLabel.Text = e.Text; + } + + private void frmEditor_FormClosing(object sender, FormClosingEventArgs e) + { + if (CheckSave() == false) + e.Cancel = true; + + } + + private void databaseEditor1_DirtyStateChanged(object sender, EventArgs e) + { + if (databaseEditor1.DirtyState) + { + if (this.Text.StartsWith("* ") == false) + { + this.Text = "* " + this.Text; + } + } + else + { + if (this.Text.StartsWith("* ") == true) + { + this.Text = this.Text.Substring(2); + } + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-30 19:53:15
|
Revision: 1217 http://agate.svn.sourceforge.net/agate/?rev=1217&view=rev Author: kanato Date: 2010-01-30 19:53:09 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Add PrimaryKeyColumn property. Modified Paths: -------------- trunk/AgateLib/Data/AgateColumn.cs trunk/AgateLib/Data/AgateColumnDictionary.cs Modified: trunk/AgateLib/Data/AgateColumn.cs =================================================================== --- trunk/AgateLib/Data/AgateColumn.cs 2010-01-30 18:38:36 UTC (rev 1216) +++ trunk/AgateLib/Data/AgateColumn.cs 2010-01-30 19:53:09 UTC (rev 1217) @@ -72,6 +72,7 @@ } #endregion + #region --- Properties --- [Browsable(false)] public int NextAutoIncrementValue @@ -85,7 +86,6 @@ set { mColumnWidth = value; } } - public string DefaultValue { get @@ -97,10 +97,6 @@ } } - internal void IncrementNextAutoIncrementValue() - { - mNextAutoIncrementValue++; - } public string Name { get { return mName; } @@ -145,6 +141,8 @@ set { mDescription = value; } } + #endregion + public override string ToString() { return "Column: " + Name; @@ -165,5 +163,9 @@ } + internal void IncrementNextAutoIncrementValue() + { + mNextAutoIncrementValue++; + } } } Modified: trunk/AgateLib/Data/AgateColumnDictionary.cs =================================================================== --- trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-01-30 18:38:36 UTC (rev 1216) +++ trunk/AgateLib/Data/AgateColumnDictionary.cs 2010-01-30 19:53:09 UTC (rev 1217) @@ -71,6 +71,14 @@ get { return mColumns.Count; } } + public AgateColumn PrimaryKeyColumn + { + get + { + return mColumns.FirstOrDefault(x => x.IsPrimaryKey); + } + } + #region IEnumerable<AgateColumn> Members public IEnumerator<AgateColumn> GetEnumerator() @@ -79,7 +87,6 @@ } #endregion - #region IEnumerable Members System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() @@ -88,7 +95,5 @@ } #endregion - - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-30 18:38:42
|
Revision: 1216 http://agate.svn.sourceforge.net/agate/?rev=1216&view=rev Author: kanato Date: 2010-01-30 18:38:36 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Deleting and cloning tables fixed up. Modified Paths: -------------- trunk/Tools/DatabaseEditor/DatabaseEditor.cs Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-30 18:27:53 UTC (rev 1215) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-30 18:38:36 UTC (rev 1216) @@ -245,6 +245,10 @@ lstTables.SelectedItems[0].BeginEdit(); } + else if (e.KeyCode == Keys.Delete) + { + deleteToolStripMenuItem_Click(sender, e); + } } private void deleteToolStripMenuItem_Click(object sender, EventArgs e) @@ -262,6 +266,7 @@ MessageBoxDefaultButton.Button2) == DialogResult.Yes) { Database.Tables.Remove(table); + DatabaseRefresh(); } } @@ -275,8 +280,42 @@ AgateTable newTable = table.Clone(); + // Append _1 to a new clone, or if there is already this suffix + // do _(i+1) where i is the suffix. + do + { + IncrementTableName(newTable); + } while (Database.Tables.ContainsTable(newTable.Name)); + + Database.Tables.Add(newTable); + DatabaseRefresh(); } + private static void IncrementTableName(AgateTable table) + { + int uindex = table.Name.LastIndexOf('_'); + bool appendCode = true; + + if (uindex > -1 && uindex < table.Name.Length - 1) + { + int value; + + if (int.TryParse(table.Name.Substring(uindex + 1), out value)) + { + table.Name = table.Name.Substring(0, uindex); + table.Name += "_" + (value + 1).ToString(); + + appendCode = false; + } + } + + if (appendCode) + { + table.Name += "_1"; + } + + } + } delegate void InvokeDelegate(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-30 18:28:01
|
Revision: 1215 http://agate.svn.sourceforge.net/agate/?rev=1215&view=rev Author: kanato Date: 2010-01-30 18:27:53 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Add cloning of tables. Modified Paths: -------------- trunk/AgateLib/Data/AgateTable.cs trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs trunk/Tools/DatabaseEditor/DatabaseEditor.cs trunk/Tools/DatabaseEditor/DatabaseEditor.resx trunk/Tools/DatabaseEditor/frmEditor.cs Modified: trunk/AgateLib/Data/AgateTable.cs =================================================================== --- trunk/AgateLib/Data/AgateTable.cs 2010-01-30 18:20:30 UTC (rev 1214) +++ trunk/AgateLib/Data/AgateTable.cs 2010-01-30 18:27:53 UTC (rev 1215) @@ -21,6 +21,20 @@ mRows = new AgateRowList(this); } + + public AgateTable Clone() + { + XleSerializer ser = new XleSerializer(typeof(AgateTable)); + + MemoryStream ms = new MemoryStream(); + + ser.Serialize(ms, this); + + ms.Position = 0; + + return FromStream(ms); + } + internal static AgateTable FromStream(Stream stream) { XleSerializer ser = new XleSerializer(typeof(AgateTable)); @@ -178,5 +192,6 @@ } } + } } Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs 2010-01-30 18:20:30 UTC (rev 1214) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs 2010-01-30 18:27:53 UTC (rev 1215) @@ -44,8 +44,8 @@ this.listToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tableContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.duplicateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.duplicateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabContextMenu.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -181,10 +181,17 @@ // renameToolStripMenuItem // this.renameToolStripMenuItem.Name = "renameToolStripMenuItem"; - this.renameToolStripMenuItem.Size = new System.Drawing.Size(126, 22); + this.renameToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.renameToolStripMenuItem.Text = "Rename..."; this.renameToolStripMenuItem.Click += new System.EventHandler(this.renameToolStripMenuItem_Click); // + // duplicateToolStripMenuItem + // + this.duplicateToolStripMenuItem.Name = "duplicateToolStripMenuItem"; + this.duplicateToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.duplicateToolStripMenuItem.Text = "Duplicate"; + this.duplicateToolStripMenuItem.Click += new System.EventHandler(this.duplicateToolStripMenuItem_Click); + // // deleteToolStripMenuItem // this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; @@ -192,12 +199,6 @@ this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // - // duplicateToolStripMenuItem - // - this.duplicateToolStripMenuItem.Name = "duplicateToolStripMenuItem"; - this.duplicateToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.duplicateToolStripMenuItem.Text = "Duplicate"; - // // DatabaseEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-30 18:20:30 UTC (rev 1214) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2010-01-30 18:27:53 UTC (rev 1215) @@ -265,6 +265,18 @@ } } + private void duplicateToolStripMenuItem_Click(object sender, EventArgs e) + { + if (lstTables.SelectedItems.Count == 0) + return; + + object obj = lstTables.SelectedItems[0].Tag; + AgateTable table = obj as AgateTable; + + AgateTable newTable = table.Clone(); + + } + } delegate void InvokeDelegate(); Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.resx =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.resx 2010-01-30 18:20:30 UTC (rev 1214) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.resx 2010-01-30 18:27:53 UTC (rev 1215) @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAs - DAAAAk1TRnQBSQFMAgEBAgEAASgBAAEoAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DAAAAk1TRnQBSQFMAgEBAgEAATABAAEwAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -188,7 +188,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABs - CQAAAk1TRnQBSQFMAgEBAgEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAATgBAAE4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA Modified: trunk/Tools/DatabaseEditor/frmEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-30 18:20:30 UTC (rev 1214) +++ trunk/Tools/DatabaseEditor/frmEditor.cs 2010-01-30 18:27:53 UTC (rev 1215) @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Windows.Forms; +using AgateDataLib; namespace AgateDatabaseEditor { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-30 18:20:36
|
Revision: 1214 http://agate.svn.sourceforge.net/agate/?rev=1214&view=rev Author: kanato Date: 2010-01-30 18:20:30 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Update AgateFMOD project to correct project reference. Modified Paths: -------------- trunk/Drivers/AgateFMOD/AgateFMOD.csproj trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs Modified: trunk/Drivers/AgateFMOD/AgateFMOD.csproj =================================================================== --- trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2010-01-30 18:12:51 UTC (rev 1213) +++ trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2010-01-30 18:20:30 UTC (rev 1214) @@ -1,7 +1,7 @@ <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.30729</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -112,13 +112,6 @@ </Reference> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\AgateLib\AgateLib.csproj"> - <Name>AgateLib</Name> - <Project>{1539806E-2473-4D67-9D10-F2CDC8C2B874}</Project> - <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> - </ProjectReference> - </ItemGroup> - <ItemGroup> <Compile Include="FMOD_Audio.cs"> <SubType>Code</SubType> </Compile> @@ -147,6 +140,12 @@ <SubType>Code</SubType> </Compile> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\AgateLib\AgateLib.csproj"> + <Project>{9490B719-829E-43A7-A5FE-8001F8A81759}</Project> + <Name>AgateLib</Name> + </ProjectReference> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <PropertyGroup> <PreBuildEvent> Modified: trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2010-01-30 18:12:51 UTC (rev 1213) +++ trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2010-01-30 18:20:30 UTC (rev 1214) @@ -109,5 +109,6 @@ { tempfiles.Add(filename); } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-01-30 18:12:56
|
Revision: 1213 http://agate.svn.sourceforge.net/agate/?rev=1213&view=rev Author: kanato Date: 2010-01-30 18:12:51 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Remove unnecessary references. Include required DotNetZip library. Modified Paths: -------------- trunk/Tools/AgateDataLib/AgateDataLib.csproj Added Paths: ----------- trunk/Tools/AgateDataLib/Ionic.Zip.Reduced.dll Modified: trunk/Tools/AgateDataLib/AgateDataLib.csproj =================================================================== --- trunk/Tools/AgateDataLib/AgateDataLib.csproj 2010-01-30 18:11:55 UTC (rev 1212) +++ trunk/Tools/AgateDataLib/AgateDataLib.csproj 2010-01-30 18:12:51 UTC (rev 1213) @@ -71,15 +71,9 @@ <Reference Include="System.Core"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml.Linq"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> - <Reference Include="System.Data.DataSetExtensions"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> Added: trunk/Tools/AgateDataLib/Ionic.Zip.Reduced.dll =================================================================== (Binary files differ) Property changes on: trunk/Tools/AgateDataLib/Ionic.Zip.Reduced.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |