Browse Source

Merge pull request #6351 from Takoooooo/platformoptions-comments

Add comments about OSX,Linux, Windows platform options
# Conflicts:
#	src/Avalonia.X11/X11Platform.cs
#	src/Windows/Avalonia.Win32/Win32Platform.cs
release/0.10.7
Jumar Macato 5 years ago
committed by Dan Walmsley
parent
commit
81be6e2ed4
  1. 35
      src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs
  2. 46
      src/Avalonia.X11/X11Platform.cs
  3. 37
      src/Windows/Avalonia.Win32/Win32Platform.cs

35
src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs

@ -26,19 +26,52 @@ namespace Avalonia
}
}
/// <summary>
/// OSX backend options.
/// </summary>
public class AvaloniaNativePlatformOptions
{
/// <summary>
/// Deferred renderer would be used when set to true. Immediate renderer when set to false. The default value is true.
/// </summary>
/// <remarks>
/// Avalonia has two rendering modes: Immediate and Deferred rendering.
/// Immediate re-renders the whole scene when some element is changed on the scene. Deferred re-renders only changed elements.
/// </remarks>
public bool UseDeferredRendering { get; set; } = true;
/// <summary>
/// Determines whether to use GPU for rendering in your project. The default value is true.
/// </summary>
public bool UseGpu { get; set; } = true;
/// <summary>
/// Embeds popups to the window when set to true. The default value is false.
/// </summary>
public bool OverlayPopups { get; set; }
/// <summary>
/// This property should be used in case you want to build Avalonia OSX native part by yourself
/// and make your Avalonia app run with it. The default value is null.
/// </summary>
public string AvaloniaNativeLibraryPath { get; set; }
}
// ReSharper disable once InconsistentNaming
/// <summary>
/// OSX front-end options.
/// </summary>
public class MacOSPlatformOptions
{
/// <summary>
/// Determines whether to show your application in the dock when it runs. The default value is true.
/// </summary>
public bool ShowInDock { get; set; } = true;
/// <summary>
/// By default, Avalonia adds items like Quit, Hide to the OSX Application Menu.
/// You can prevent Avalonia from adding those items to the OSX Application Menu with this property. The default value is false.
/// </summary>
public bool DisableDefaultApplicationMenuItems { get; set; }
}
}

46
src/Avalonia.X11/X11Platform.cs

@ -162,14 +162,49 @@ namespace Avalonia.X11
namespace Avalonia
{
/// <summary>
/// Platform-specific options which apply to Linux.
/// </summary>
public class X11PlatformOptions
{
/// <summary>
/// Enables native Linux EGL when set to true. The default value is false.
/// </summary>
public bool UseEGL { get; set; }
/// <summary>
/// Determines whether to use GPU for rendering in your project. The default value is true.
/// </summary>
public bool UseGpu { get; set; } = true;
/// <summary>
/// Embeds popups to the window when set to true. The default value is false.
/// </summary>
public bool OverlayPopups { get; set; }
/// <summary>
/// Enables global menu support on Linux desktop environments where it's supported (e. g. XFCE and MATE with plugin, KDE, etc).
/// The default value is false.
/// </summary>
public bool UseDBusMenu { get; set; }
/// <summary>
/// Deferred renderer would be used when set to true. Immediate renderer when set to false. The default value is true.
/// </summary>
/// <remarks>
/// Avalonia has two rendering modes: Immediate and Deferred rendering.
/// Immediate re-renders the whole scene when some element is changed on the scene. Deferred re-renders only changed elements.
/// </remarks>
public bool UseDeferredRendering { get; set; } = true;
/// <summary>
/// Determines whether to use IME.
/// IME would be enabled by default if the current user input language is one of the following: Mandarin, Japanese, Vietnamese or Korean.
/// </summary>
/// <remarks>
/// Input method editor is a component that enables users to generate characters not natively available
/// on their input devices by using sequences of characters or mouse operations that are natively available on their input devices.
/// </remarks>
public bool? EnableIme { get; set; }
public IList<GlVersion> GlProfiles { get; set; } = new List<GlVersion>
@ -190,7 +225,14 @@ namespace Avalonia
"llvmpipe"
};
public string WmClass { get; set; } = Assembly.GetEntryAssembly()?.GetName()?.Name ?? "AvaloniaApplication";
public bool? EnableMultiTouch { get; set; }
/// <summary>
/// Enables multitouch support. The default value is true.
/// </summary>
/// <remarks>
/// Multitouch allows a surface (a touchpad or touchscreen) to recognize the presence of more than one point of contact with the surface at the same time.
/// </remarks>
public bool? EnableMultiTouch { get; set; } = true;
}
public static class AvaloniaX11PlatformExtensions
{

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

@ -35,15 +35,46 @@ namespace Avalonia
}
}
/// <summary>
/// Platform-specific options which apply to Windows.
/// </summary>
public class Win32PlatformOptions
{
/// <summary>
/// Deferred renderer would be used when set to true. Immediate renderer when set to false. The default value is true.
/// </summary>
/// <remarks>
/// Avalonia has two rendering modes: Immediate and Deferred rendering.
/// Immediate re-renders the whole scene when some element is changed on the scene. Deferred re-renders only changed elements.
/// </remarks>
public bool UseDeferredRendering { get; set; } = true;
/// <summary>
/// Enables ANGLE for Windows. For every Windows version that is above Windows 7, the default is true otherwise it's false.
/// </summary>
/// <remarks>
/// GPU rendering will not be enabled if this is set to false.
/// </remarks>
public bool? AllowEglInitialization { get; set; }
public bool? EnableMultitouch { get; set; }
/// <summary>
/// Enables multitouch support. The default value is true.
/// </summary>
/// <remarks>
/// Multitouch allows a surface (a touchpad or touchscreen) to recognize the presence of more than one point of contact with the surface at the same time.
/// </remarks>
public bool? EnableMultitouch { get; set; } = true;
/// <summary>
/// Embeds popups to the window when set to true. The default value is false.
/// </summary>
public bool OverlayPopups { get; set; }
/// <summary>
/// Avalonia would try to use native Widows OpenGL when set to true. The default value is false.
/// </summary>
public bool UseWgl { get; set; }
public IList<GlVersion> WglProfiles { get; set; } = new List<GlVersion>
{
new GlVersion(GlProfileType.OpenGL, 4, 0),

Loading…
Cancel
Save