├── .gitignore
├── LICENSE.md
├── NoesisGUI.MonoGameWrapper.sln
├── NoesisGUI.MonoGameWrapper
├── Config
│ ├── HitTestIgnoreDelegate.cs
│ └── NoesisConfig.cs
├── Helpers
│ ├── DeviceState
│ │ ├── DeviceStateHelper.cs
│ │ └── DeviceStateHelperD3D11.cs
│ ├── KeyConverter.cs
│ ├── NoesisTextureHelper.cs
│ └── XnaKeysComparer.cs
├── Input
│ ├── Devices
│ │ ├── Keyboard.cs
│ │ └── Mouse.cs
│ ├── InputManager.cs
│ ├── Platforms
│ │ └── Windows
│ │ │ ├── KeyboardImeWinforms.cs
│ │ │ ├── Win32MessageCode.cs
│ │ │ └── Win32Native.cs
│ └── SystemSettings
│ │ ├── InputSettingsHelper.cs
│ │ └── WinFormsInputSettingsHelper.cs
├── NoesisGUI.MonoGameWrapper.csproj
├── NoesisGUI.MonoGameWrapper.csproj.DotSettings
├── NoesisGUI.MonoGameWrapper.sln
├── NoesisViewWrapper.cs
├── NoesisWrapper.cs
└── Providers
│ ├── ContentTextureProvider.cs
│ ├── FolderFontProvider.cs
│ ├── FolderTextureProvider.cs
│ ├── FolderXamlProvider.cs
│ └── NoesisProviderManager.cs
├── README.md
└── TestMonoGameNoesisGUI
├── GUI
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Resources.xaml
├── Samples
│ ├── Animation.xaml
│ ├── Brushes.xaml
│ ├── Button.xaml
│ ├── Canvas.xaml
│ ├── CheckBox.xaml
│ ├── ComboBox.xaml
│ ├── ContextMenu.xaml
│ ├── DockPanel.xaml
│ ├── Effects.xaml
│ ├── Expander.xaml
│ ├── Fonts
│ │ ├── Aero Matics Regular.ttf
│ │ ├── Caladea-Regular.ttf
│ │ ├── CourierPrime-Regular.ttf
│ │ ├── Muli-Bold.ttf
│ │ ├── Muli-Italic.ttf
│ │ ├── Muli-Regular.ttf
│ │ └── WidgetIcons.ttf
│ ├── Grid.xaml
│ ├── GroupBox.xaml
│ ├── Hyperlink.xaml
│ ├── Image.xaml
│ ├── Images
│ │ ├── Nature.png
│ │ ├── file.png
│ │ ├── floppy-disk.png
│ │ ├── folder-closed.png
│ │ ├── folder-open.png
│ │ ├── recycling-bin.png
│ │ └── search.png
│ ├── ItemsControl.xaml
│ ├── ListBox.xaml
│ ├── ListView.xaml
│ ├── Menu.xaml
│ ├── PasswordBox.xaml
│ ├── ProgressBar.xaml
│ ├── RadioButton.xaml
│ ├── RepeatButton.xaml
│ ├── ScrollViewer.xaml
│ ├── Slider.xaml
│ ├── StackPanel.xaml
│ ├── StatusBar.xaml
│ ├── TabControl.xaml
│ ├── TextBlock.xaml
│ ├── TextBox.xaml
│ ├── ToggleButton.xaml
│ ├── ToolBar.xaml
│ ├── ToolTip.xaml
│ ├── TreeView.xaml
│ ├── UniformGrid.xaml
│ └── WrapPanel.xaml
└── Theme
│ ├── Fonts
│ ├── PT Root UI_Bold.otf
│ └── PT Root UI_Regular.otf
│ ├── NoesisTheme.Brushes.DarkAqua.xaml
│ ├── NoesisTheme.Brushes.DarkBlue.xaml
│ ├── NoesisTheme.Brushes.DarkCrimson.xaml
│ ├── NoesisTheme.Brushes.DarkEmerald.xaml
│ ├── NoesisTheme.Brushes.DarkGreen.xaml
│ ├── NoesisTheme.Brushes.DarkLime.xaml
│ ├── NoesisTheme.Brushes.DarkOrange.xaml
│ ├── NoesisTheme.Brushes.DarkPurple.xaml
│ ├── NoesisTheme.Brushes.DarkRed.xaml
│ ├── NoesisTheme.Brushes.LightAqua.xaml
│ ├── NoesisTheme.Brushes.LightBlue.xaml
│ ├── NoesisTheme.Brushes.LightCrimson.xaml
│ ├── NoesisTheme.Brushes.LightEmerald.xaml
│ ├── NoesisTheme.Brushes.LightGreen.xaml
│ ├── NoesisTheme.Brushes.LightLime.xaml
│ ├── NoesisTheme.Brushes.LightOrange.xaml
│ ├── NoesisTheme.Brushes.LightPurple.xaml
│ ├── NoesisTheme.Brushes.LightRed.xaml
│ ├── NoesisTheme.Colors.Dark.xaml
│ ├── NoesisTheme.Colors.Light.xaml
│ ├── NoesisTheme.DarkAqua.xaml
│ ├── NoesisTheme.DarkBlue.xaml
│ ├── NoesisTheme.DarkCrimson.xaml
│ ├── NoesisTheme.DarkEmerald.xaml
│ ├── NoesisTheme.DarkGreen.xaml
│ ├── NoesisTheme.DarkLime.xaml
│ ├── NoesisTheme.DarkOrange.xaml
│ ├── NoesisTheme.DarkPurple.xaml
│ ├── NoesisTheme.DarkRed.xaml
│ ├── NoesisTheme.Fonts.xaml
│ ├── NoesisTheme.LightAqua.xaml
│ ├── NoesisTheme.LightBlue.xaml
│ ├── NoesisTheme.LightCrimson.xaml
│ ├── NoesisTheme.LightEmerald.xaml
│ ├── NoesisTheme.LightGreen.xaml
│ ├── NoesisTheme.LightLime.xaml
│ ├── NoesisTheme.LightOrange.xaml
│ ├── NoesisTheme.LightPurple.xaml
│ ├── NoesisTheme.LightRed.xaml
│ └── NoesisTheme.Styles.xaml
├── GameWithNoesis.cs
├── Icon.ico
├── Program.cs
├── TestMonoGameNoesisGUI.csproj
├── app.config
├── app.manifest
└── packages.config
/.gitignore:
--------------------------------------------------------------------------------
1 | #Folders
2 | Library/
3 | Temp/
4 | Builds/
5 | obj/
6 | bin/
7 |
8 | *.suo
9 | *.user
10 | *.userprefs
11 | *.pidb
12 |
13 | #OS Junk
14 | Thumbs.db
15 | .DS_Store*
16 | ehthumbs.db
17 | Icon7
18 |
19 | /.project
20 |
21 | *.psess
22 | *.vsp
23 | *.opensdf
24 | *.sdf
25 |
26 | *.tmp
27 |
28 | /NoesisGUI-CSharpSDK/*
29 | !/NoesisGUI-CSharpSDK/Extract NoesisGUI SDK here
30 |
31 | /Libs/Output
32 | */Libs/Output
33 | .vs/
34 | .idea/
35 | packages/
36 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 NoesisGUI MonoGame Integration
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/NoesisGUI.MonoGameWrapper.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31624.102
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NoesisGUI.MonoGameWrapper", "NoesisGUI.MonoGameWrapper\NoesisGUI.MonoGameWrapper.csproj", "{7B629986-9BCF-48F4-AACA-6AA872154C81}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestMonoGameNoesisGUI", "TestMonoGameNoesisGUI\TestMonoGameNoesisGUI.csproj", "{24AC8B94-0651-4FC7-956A-F05F2E664C69}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|x86 = Debug|x86
14 | Release|Any CPU = Release|Any CPU
15 | Release|x86 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Debug|x86.ActiveCfg = Debug|Any CPU
21 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Debug|x86.Build.0 = Debug|Any CPU
22 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Release|x86.ActiveCfg = Release|Any CPU
25 | {7B629986-9BCF-48F4-AACA-6AA872154C81}.Release|x86.Build.0 = Release|Any CPU
26 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Debug|x86.ActiveCfg = Debug|Any CPU
29 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Debug|x86.Build.0 = Debug|Any CPU
30 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Release|x86.ActiveCfg = Release|Any CPU
33 | {24AC8B94-0651-4FC7-956A-F05F2E664C69}.Release|x86.Build.0 = Release|Any CPU
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | GlobalSection(ExtensibilityGlobals) = postSolution
39 | SolutionGuid = {A4CE57D6-6586-4DC7-9FA5-354F4897A303}
40 | EndGlobalSection
41 | EndGlobal
42 |
--------------------------------------------------------------------------------
/NoesisGUI.MonoGameWrapper/Config/HitTestIgnoreDelegate.cs:
--------------------------------------------------------------------------------
1 | namespace NoesisGUI.MonoGameWrapper
2 | {
3 | using Noesis;
4 |
5 | public delegate bool HitTestIgnoreDelegate(Visual element);
6 | }
--------------------------------------------------------------------------------
/NoesisGUI.MonoGameWrapper/Helpers/DeviceState/DeviceStateHelper.cs:
--------------------------------------------------------------------------------
1 | namespace NoesisGUI.MonoGameWrapper.Helpers.DeviceState
2 | {
3 | using System;
4 |
5 | internal abstract class DeviceStateHelper
6 | {
7 | public DeviceStateRestorer Remember()
8 | {
9 | this.Save();
10 | return new DeviceStateRestorer(this);
11 | }
12 |
13 | protected abstract void Restore();
14 |
15 | protected abstract void Save();
16 |
17 | ///
18 | /// Disposable structure which calls the state.Restore() method during Dispose().
19 | ///
20 | internal struct DeviceStateRestorer : IDisposable
21 | {
22 | private readonly DeviceStateHelper state;
23 |
24 | internal DeviceStateRestorer(DeviceStateHelper state)
25 | {
26 | this.state = state;
27 | }
28 |
29 | public void Dispose()
30 | {
31 | this.state.Restore();
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/NoesisGUI.MonoGameWrapper/Helpers/NoesisTextureHelper.cs:
--------------------------------------------------------------------------------
1 | namespace NoesisGUI.MonoGameWrapper.Helpers
2 | {
3 | using System;
4 | using System.Reflection;
5 | using SharpDX.Direct3D11;
6 | using Texture = Noesis.Texture;
7 | using Texture2D = Microsoft.Xna.Framework.Graphics.Texture2D;
8 |
9 | public static class NoesisTextureHelper
10 | {
11 | // We need the native texture pointer for the SharpDX texture
12 | // but this API is not available in MonoGame.Texture class.
13 | // Here we're using reflection to access the internal method.
14 | private static readonly MethodInfo GetTextureMethod
15 | = typeof(Texture2D).GetMethod("GetTexture",
16 | BindingFlags.NonPublic | BindingFlags.Instance);
17 |
18 | public static Texture CreateNoesisTexture(Texture2D texture)
19 | {
20 | if (texture == null)
21 | {
22 | return null;
23 | }
24 |
25 | if (texture.IsDisposed)
26 | {
27 | return null;
28 |
29 | throw new Exception("Cannot wrap the disposed texture: " + texture);
30 | }
31 |
32 | var textureNativePointer = GetTextureNativePointer(texture);
33 |
34 | return Texture.WrapD3D11Texture(
35 | texture,
36 | textureNativePointer,
37 | texture.Width,
38 | texture.Height,
39 | texture.LevelCount,
40 | isInverted: false);
41 | }
42 |
43 | private static IntPtr GetTextureNativePointer(Texture2D texture)
44 | {
45 | var resource = (Resource)GetTextureMethod.Invoke(texture, Array.Empty