Browse Source

add comments

pull/6351/head
Takoooooo 5 years ago
parent
commit
3dd91adc27
  1. 35
      src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs
  2. 43
      src/Avalonia.X11/X11Platform.cs
  3. 35
      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 public class AvaloniaNativePlatformOptions
{ {
/// <summary>
/// Deferred renderer would be used on Windows when set to true. Immediate renderer would be used when set to false. The default value is true.
/// </summary>
/// <remarks>
/// Avalonia has two different renderers - Immediate and Deferred.
/// 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; 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; 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; } 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; } public string AvaloniaNativeLibraryPath { get; set; }
} }
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
/// <summary>
/// OSX front-end options.
/// </summary>
public class MacOSPlatformOptions 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; 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; } public bool DisableDefaultApplicationMenuItems { get; set; }
} }
} }

43
src/Avalonia.X11/X11Platform.cs

@ -162,14 +162,48 @@ namespace Avalonia.X11
namespace Avalonia namespace Avalonia
{ {
/// <summary>
/// Platform-specific options which apply to Linux.
/// </summary>
public class X11PlatformOptions public class X11PlatformOptions
{ {
/// <summary>
/// Enables native Linux EGL when set to true. The default value is false.
/// </summary>
public bool UseEGL { get; set; } 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; 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; } public bool OverlayPopups { get; set; }
/// <summary>
/// Enables global KDE menu. The default value is false.
/// </summary>
public bool UseDBusMenu { get; set; } public bool UseDBusMenu { get; set; }
/// <summary>
/// Deferred renderer would be used on Windows when set to true. Immediate renderer would be used when set to false. The default value is true.
/// </summary>
/// <remarks>
/// Avalonia has two different renderers - Immediate and Deferred.
/// 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; public bool UseDeferredRendering { get; set; } = true;
/// <summary>
/// Determines whether to use IME.
/// IME would be enabled by default if user input languages contain one of the following languages: Mandarin Chinese, Japanese, Vietnamese, 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 bool? EnableIme { get; set; }
public IList<GlVersion> GlProfiles { get; set; } = new List<GlVersion> public IList<GlVersion> GlProfiles { get; set; } = new List<GlVersion>
@ -190,6 +224,13 @@ namespace Avalonia
"llvmpipe" "llvmpipe"
}; };
public string WmClass { get; set; } = Assembly.GetEntryAssembly()?.GetName()?.Name ?? "AvaloniaApplication"; public string WmClass { get; set; } = Assembly.GetEntryAssembly()?.GetName()?.Name ?? "AvaloniaApplication";
/// <summary>
/// Enables multitouch support. The default value is false.
/// </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; } public bool? EnableMultiTouch { get; set; }
} }
public static class AvaloniaX11PlatformExtensions public static class AvaloniaX11PlatformExtensions

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

@ -35,15 +35,46 @@ namespace Avalonia
} }
} }
/// <summary>
/// Platform-specific options which apply to Windows.
/// </summary>
public class Win32PlatformOptions public class Win32PlatformOptions
{ {
/// <summary>
/// Deferred renderer would be used on Windows when set to true. Immediate renderer would be used when set to false. The default value is true.
/// </summary>
/// <remarks>
/// Avalonia has two different renderers - Immediate and Deferred.
/// 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; public bool UseDeferredRendering { get; set; } = true;
/// <summary>
/// Enables ANGLE for Windows. For every Windows which is above Win 7, the default is true,otherwise-false.
/// </summary>
/// <remarks>
/// GPU would not be used for rendering if you would set that to false.
/// </remarks>
public bool? AllowEglInitialization { get; set; } public bool? AllowEglInitialization { get; set; }
/// <summary>
/// Enables multitouch support. The default value is false.
/// </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; } public bool? EnableMultitouch { get; set; }
/// <summary>
/// Embeds popups to the window when set to true. The default value is false.
/// </summary>
public bool OverlayPopups { get; set; } 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 bool UseWgl { get; set; }
public IList<GlVersion> WglProfiles { get; set; } = new List<GlVersion> public IList<GlVersion> WglProfiles { get; set; } = new List<GlVersion>
{ {
new GlVersion(GlProfileType.OpenGL, 4, 0), new GlVersion(GlProfileType.OpenGL, 4, 0),

Loading…
Cancel
Save