Browse Source

Merge branch 'master' into control-resources

pull/1130/head
Steven Kirk 9 years ago
committed by GitHub
parent
commit
dddf1ebd40
  1. 19
      build/UnitTests.NetCore.targets
  2. 13
      src/Avalonia.DotNetFrameworkRuntime/AppBuilder.cs
  3. 1
      src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj
  4. 1
      src/Linux/Avalonia.LinuxFramebuffer/NativeUnsafeMethods.cs
  5. 1
      src/Windows/Avalonia.Designer/AppHost/HostedAppModel.cs
  6. 4
      src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs
  7. 2
      src/Windows/Avalonia.Win32/Win32Platform.cs
  8. 6
      src/Windows/Avalonia.Win32/WindowImpl.cs
  9. 2
      tests/Avalonia.Input.UnitTests/Avalonia.Input.UnitTests.csproj
  10. 1
      tests/Avalonia.Styling.UnitTests/Avalonia.Styling.UnitTests.csproj

19
build/UnitTests.NetCore.targets

@ -3,25 +3,6 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Threading.Thread" Version="4.3.0" /> <PackageReference Include="System.Threading.Thread" Version="4.3.0" />
</ItemGroup> </ItemGroup>

13
src/Avalonia.DotNetFrameworkRuntime/AppBuilder.cs

@ -59,7 +59,11 @@ namespace Avalonia
from attribute in assembly.GetCustomAttributes<ExportWindowingSubsystemAttribute>() from attribute in assembly.GetCustomAttributes<ExportWindowingSubsystemAttribute>()
where attribute.RequiredOS == os && CheckEnvironment(attribute.EnvironmentChecker) where attribute.RequiredOS == os && CheckEnvironment(attribute.EnvironmentChecker)
orderby attribute.Priority ascending orderby attribute.Priority ascending
select attribute).First(); select attribute).FirstOrDefault();
if (windowingSubsystemAttribute == null)
{
throw new InvalidOperationException("No windowing subsystem found. Are you missing assembly references?");
}
var renderingSubsystemAttribute = (from assembly in RuntimePlatform.GetLoadedAssemblies() var renderingSubsystemAttribute = (from assembly in RuntimePlatform.GetLoadedAssemblies()
from attribute in assembly.GetCustomAttributes<ExportRenderingSubsystemAttribute>() from attribute in assembly.GetCustomAttributes<ExportRenderingSubsystemAttribute>()
@ -67,7 +71,12 @@ namespace Avalonia
where attribute.RequiresWindowingSubsystem == null where attribute.RequiresWindowingSubsystem == null
|| attribute.RequiresWindowingSubsystem == windowingSubsystemAttribute.Name || attribute.RequiresWindowingSubsystem == windowingSubsystemAttribute.Name
orderby attribute.Priority ascending orderby attribute.Priority ascending
select attribute).First(); select attribute).FirstOrDefault();
if (renderingSubsystemAttribute == null)
{
throw new InvalidOperationException("No rendering subsystem found. Are you missing assembly references?");
}
UseWindowingSubsystem(() => windowingSubsystemAttribute.InitializationType UseWindowingSubsystem(() => windowingSubsystemAttribute.InitializationType
.GetRuntimeMethod(windowingSubsystemAttribute.InitializationMethod, Type.EmptyTypes).Invoke(null, null), .GetRuntimeMethod(windowingSubsystemAttribute.InitializationMethod, Type.EmptyTypes).Invoke(null, null),

1
src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj

@ -4,6 +4,7 @@
<EnableDefaultCompileItems>False</EnableDefaultCompileItems> <EnableDefaultCompileItems>False</EnableDefaultCompileItems>
<EnableDefaultItems>False</EnableDefaultItems> <EnableDefaultItems>False</EnableDefaultItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NoWarn>CS0436</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>

1
src/Linux/Avalonia.LinuxFramebuffer/NativeUnsafeMethods.cs

@ -72,6 +72,7 @@ namespace Avalonia.LinuxFramebuffer
FB_VBLANK_HAVE_VSYNC = 0x100 /* verical syncs can be detected */ FB_VBLANK_HAVE_VSYNC = 0x100 /* verical syncs can be detected */
} }
[StructLayout(LayoutKind.Sequential)]
unsafe struct fb_vblank { unsafe struct fb_vblank {
public VBlankFlags flags; /* FB_VBLANK flags */ public VBlankFlags flags; /* FB_VBLANK flags */
__u32 count; /* counter of retraces since boot */ __u32 count; /* counter of retraces since boot */

1
src/Windows/Avalonia.Designer/AppHost/HostedAppModel.cs

@ -86,7 +86,6 @@ namespace Avalonia.Designer.AppHost
} }
double _currentScalingFactor = 1; double _currentScalingFactor = 1;
private string _color;
private string _background; private string _background;
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;

4
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs

@ -922,9 +922,7 @@ namespace Avalonia.Win32.Interop
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal class MONITORINFO internal class MONITORINFO
{ {
#pragma warning disable CS0618 // Type or member is obsolete public int cbSize = Marshal.SizeOf<MONITORINFO>();
public int cbSize = Marshal.SizeOf(typeof(MONITORINFO));
#pragma warning restore CS0618 // Type or member is obsolete
public RECT rcMonitor = new RECT(); public RECT rcMonitor = new RECT();
public RECT rcWork = new RECT(); public RECT rcWork = new RECT();
public int dwFlags = 0; public int dwFlags = 0;

2
src/Windows/Avalonia.Win32/Win32Platform.cs

@ -167,7 +167,7 @@ namespace Avalonia.Win32
UnmanagedMethods.WNDCLASSEX wndClassEx = new UnmanagedMethods.WNDCLASSEX UnmanagedMethods.WNDCLASSEX wndClassEx = new UnmanagedMethods.WNDCLASSEX
{ {
cbSize = Marshal.SizeOf(typeof(UnmanagedMethods.WNDCLASSEX)), cbSize = Marshal.SizeOf<UnmanagedMethods.WNDCLASSEX>(),
lpfnWndProc = _wndProcDelegate, lpfnWndProc = _wndProcDelegate,
hInstance = UnmanagedMethods.GetModuleHandle(null), hInstance = UnmanagedMethods.GetModuleHandle(null),
lpszClassName = "AvaloniaMessageWindow " + Guid.NewGuid(), lpszClassName = "AvaloniaMessageWindow " + Guid.NewGuid(),

6
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -426,7 +426,7 @@ namespace Avalonia.Win32
case UnmanagedMethods.WindowsMessage.WM_DPICHANGED: case UnmanagedMethods.WindowsMessage.WM_DPICHANGED:
var dpi = ToInt32(wParam) & 0xffff; var dpi = ToInt32(wParam) & 0xffff;
var newDisplayRect = (UnmanagedMethods.RECT)Marshal.PtrToStructure(lParam, typeof(UnmanagedMethods.RECT)); var newDisplayRect = Marshal.PtrToStructure<UnmanagedMethods.RECT>(lParam);
Position = new Point(newDisplayRect.left, newDisplayRect.top); Position = new Point(newDisplayRect.left, newDisplayRect.top);
_scaling = dpi / 96.0; _scaling = dpi / 96.0;
ScalingChanged?.Invoke(_scaling); ScalingChanged?.Invoke(_scaling);
@ -494,7 +494,7 @@ namespace Avalonia.Win32
{ {
var tm = new UnmanagedMethods.TRACKMOUSEEVENT var tm = new UnmanagedMethods.TRACKMOUSEEVENT
{ {
cbSize = Marshal.SizeOf(typeof(UnmanagedMethods.TRACKMOUSEEVENT)), cbSize = Marshal.SizeOf<UnmanagedMethods.TRACKMOUSEEVENT>(),
dwFlags = 2, dwFlags = 2,
hwndTrack = _hwnd, hwndTrack = _hwnd,
dwHoverTime = 0, dwHoverTime = 0,
@ -619,7 +619,7 @@ namespace Avalonia.Win32
UnmanagedMethods.WNDCLASSEX wndClassEx = new UnmanagedMethods.WNDCLASSEX UnmanagedMethods.WNDCLASSEX wndClassEx = new UnmanagedMethods.WNDCLASSEX
{ {
cbSize = Marshal.SizeOf(typeof(UnmanagedMethods.WNDCLASSEX)), cbSize = Marshal.SizeOf<UnmanagedMethods.WNDCLASSEX>(),
style = 0, style = 0,
lpfnWndProc = _wndProcDelegate, lpfnWndProc = _wndProcDelegate,
hInstance = UnmanagedMethods.GetModuleHandle(null), hInstance = UnmanagedMethods.GetModuleHandle(null),

2
tests/Avalonia.Input.UnitTests/Avalonia.Input.UnitTests.csproj

@ -22,4 +22,4 @@
<ItemGroup> <ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup> </ItemGroup>
</Project> </Project>

1
tests/Avalonia.Styling.UnitTests/Avalonia.Styling.UnitTests.csproj

@ -2,6 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net461;netcoreapp1.1</TargetFrameworks> <TargetFrameworks>net461;netcoreapp1.1</TargetFrameworks>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<NoWarn>CS0067</NoWarn>
</PropertyGroup> </PropertyGroup>
<Import Project="..\..\build\UnitTests.NetCore.targets" /> <Import Project="..\..\build\UnitTests.NetCore.targets" />
<Import Project="..\..\build\Moq.props" /> <Import Project="..\..\build\Moq.props" />

Loading…
Cancel
Save