From 3dd91adc2725f6d6bbf18bef65a147e7ef256561 Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Mon, 2 Aug 2021 10:38:40 +0300 Subject: [PATCH 1/4] add comments --- .../AvaloniaNativePlatformExtensions.cs | 35 ++++++++++++++- src/Avalonia.X11/X11Platform.cs | 43 ++++++++++++++++++- src/Windows/Avalonia.Win32/Win32Platform.cs | 35 ++++++++++++++- 3 files changed, 109 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs index 76cb7a8057..51d3556dfd 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs @@ -26,19 +26,52 @@ namespace Avalonia } } + /// + /// OSX backend options. + /// public class AvaloniaNativePlatformOptions { + /// + /// 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. + /// + /// + /// 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. + /// public bool UseDeferredRendering { get; set; } = true; + + /// + /// Determines whether to use GPU for rendering in your project. The default value is true. + /// public bool UseGpu { get; set; } = true; + + /// + /// Embeds popups to the window when set to true. The default value is false. + /// public bool OverlayPopups { get; set; } + + /// + /// 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. + /// public string AvaloniaNativeLibraryPath { get; set; } } // ReSharper disable once InconsistentNaming + /// + /// OSX front-end options. + /// public class MacOSPlatformOptions { + /// + /// Determines whether to show your application in the dock when it runs. The default value is true. + /// public bool ShowInDock { get; set; } = true; - + + /// + /// 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. + /// public bool DisableDefaultApplicationMenuItems { get; set; } } } diff --git a/src/Avalonia.X11/X11Platform.cs b/src/Avalonia.X11/X11Platform.cs index a57bdbdf87..0eb716badd 100644 --- a/src/Avalonia.X11/X11Platform.cs +++ b/src/Avalonia.X11/X11Platform.cs @@ -162,14 +162,48 @@ namespace Avalonia.X11 namespace Avalonia { - + /// + /// Platform-specific options which apply to Linux. + /// public class X11PlatformOptions { + /// + /// Enables native Linux EGL when set to true. The default value is false. + /// public bool UseEGL { get; set; } + + /// + /// Determines whether to use GPU for rendering in your project. The default value is true. + /// public bool UseGpu { get; set; } = true; + + /// + /// Embeds popups to the window when set to true. The default value is false. + /// public bool OverlayPopups { get; set; } + + /// + /// Enables global KDE menu. The default value is false. + /// public bool UseDBusMenu { get; set; } + + /// + /// 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. + /// + /// + /// 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. + /// public bool UseDeferredRendering { get; set; } = true; + + /// + /// 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. + /// + /// + /// 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. + /// public bool? EnableIme { get; set; } public IList GlProfiles { get; set; } = new List @@ -190,6 +224,13 @@ namespace Avalonia "llvmpipe" }; public string WmClass { get; set; } = Assembly.GetEntryAssembly()?.GetName()?.Name ?? "AvaloniaApplication"; + + /// + /// Enables multitouch support. The default value is false. + /// + /// + /// 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. + /// public bool? EnableMultiTouch { get; set; } } public static class AvaloniaX11PlatformExtensions diff --git a/src/Windows/Avalonia.Win32/Win32Platform.cs b/src/Windows/Avalonia.Win32/Win32Platform.cs index 10a6db0b57..cf46db69eb 100644 --- a/src/Windows/Avalonia.Win32/Win32Platform.cs +++ b/src/Windows/Avalonia.Win32/Win32Platform.cs @@ -35,15 +35,46 @@ namespace Avalonia } } + /// + /// Platform-specific options which apply to Windows. + /// public class Win32PlatformOptions { + /// + /// 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. + /// + /// + /// 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. + /// public bool UseDeferredRendering { get; set; } = true; - + + /// + /// Enables ANGLE for Windows. For every Windows which is above Win 7, the default is true,otherwise-false. + /// + /// + /// GPU would not be used for rendering if you would set that to false. + /// public bool? AllowEglInitialization { get; set; } - + + /// + /// Enables multitouch support. The default value is false. + /// + /// + /// 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. + /// public bool? EnableMultitouch { get; set; } + + /// + /// Embeds popups to the window when set to true. The default value is false. + /// public bool OverlayPopups { get; set; } + + /// + /// Avalonia would try to use native Widows OpenGL when set to true. The default value is false. + /// public bool UseWgl { get; set; } + public IList WglProfiles { get; set; } = new List { new GlVersion(GlProfileType.OpenGL, 4, 0), From c2c97901118dee637bd84925af7119ed77f430ea Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Wed, 4 Aug 2021 12:21:56 +0300 Subject: [PATCH 2/4] update --- src/Avalonia.X11/X11Platform.cs | 2 +- src/Windows/Avalonia.Win32/Win32Platform.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.X11/X11Platform.cs b/src/Avalonia.X11/X11Platform.cs index f4a1079455..df1c542159 100644 --- a/src/Avalonia.X11/X11Platform.cs +++ b/src/Avalonia.X11/X11Platform.cs @@ -226,7 +226,7 @@ namespace Avalonia public string WmClass { get; set; } = Assembly.GetEntryAssembly()?.GetName()?.Name ?? "AvaloniaApplication"; /// - /// Enables multitouch support. The default value is false. + /// Enables multitouch support. The default value is true. /// /// /// 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. diff --git a/src/Windows/Avalonia.Win32/Win32Platform.cs b/src/Windows/Avalonia.Win32/Win32Platform.cs index 86f348bd01..0240655761 100644 --- a/src/Windows/Avalonia.Win32/Win32Platform.cs +++ b/src/Windows/Avalonia.Win32/Win32Platform.cs @@ -58,7 +58,7 @@ namespace Avalonia public bool? AllowEglInitialization { get; set; } /// - /// Enables multitouch support. The default value is false. + /// Enables multitouch support. The default value is true. /// /// /// 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. From f283921e281077c74fd6c3b135e624b00b848293 Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Wed, 4 Aug 2021 12:50:15 +0300 Subject: [PATCH 3/4] fix --- src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs | 4 ++-- src/Avalonia.X11/X11Platform.cs | 6 +++--- src/Windows/Avalonia.Win32/Win32Platform.cs | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs index 51d3556dfd..eef765e7ec 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs @@ -32,10 +32,10 @@ namespace Avalonia public class AvaloniaNativePlatformOptions { /// - /// 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. + /// Deferred renderer would be used when set to true. Immediate renderer when set to false. The default value is true. /// /// - /// Avalonia has two different renderers - Immediate and Deferred. + /// 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. /// public bool UseDeferredRendering { get; set; } = true; diff --git a/src/Avalonia.X11/X11Platform.cs b/src/Avalonia.X11/X11Platform.cs index df1c542159..1f9c91aa2b 100644 --- a/src/Avalonia.X11/X11Platform.cs +++ b/src/Avalonia.X11/X11Platform.cs @@ -188,17 +188,17 @@ namespace Avalonia public bool UseDBusMenu { get; set; } /// - /// 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. + /// Deferred renderer would be used when set to true. Immediate renderer when set to false. The default value is true. /// /// - /// Avalonia has two different renderers - Immediate and Deferred. + /// 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. /// public bool UseDeferredRendering { get; set; } = true; /// /// 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. + /// IME would be enabled by default if the current user input language is one of the following: Mandarin, Japanese, Vietnamese or Korean. /// /// /// Input method editor is a component that enables users to generate characters not natively available diff --git a/src/Windows/Avalonia.Win32/Win32Platform.cs b/src/Windows/Avalonia.Win32/Win32Platform.cs index 0240655761..a881c45cd0 100644 --- a/src/Windows/Avalonia.Win32/Win32Platform.cs +++ b/src/Windows/Avalonia.Win32/Win32Platform.cs @@ -41,19 +41,19 @@ namespace Avalonia public class Win32PlatformOptions { /// - /// 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. + /// Deferred renderer would be used when set to true. Immediate renderer when set to false. The default value is true. /// /// - /// Avalonia has two different renderers - Immediate and Deferred. + /// 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. /// public bool UseDeferredRendering { get; set; } = true; /// - /// Enables ANGLE for Windows. For every Windows which is above Win 7, the default is true,otherwise-false. + /// Enables ANGLE for Windows. For every Windows version that is above Windows 7, the default is true otherwise it's false. /// /// - /// GPU would not be used for rendering if you would set that to false. + /// GPU rendering will not be enabled if this is set to false. /// public bool? AllowEglInitialization { get; set; } From 037047299791cee0338a17f241614300bdc96e85 Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Wed, 4 Aug 2021 13:13:36 +0300 Subject: [PATCH 4/4] update --- src/Avalonia.X11/X11Platform.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.X11/X11Platform.cs b/src/Avalonia.X11/X11Platform.cs index 1f9c91aa2b..3a919c8814 100644 --- a/src/Avalonia.X11/X11Platform.cs +++ b/src/Avalonia.X11/X11Platform.cs @@ -183,7 +183,8 @@ namespace Avalonia public bool OverlayPopups { get; set; } /// - /// Enables global KDE menu. The default value is false. + /// 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. /// public bool UseDBusMenu { get; set; }