* Remove the flowDirection parameter from TextCollapsingProperties.CreateCollapsedRuns
* Simplify text formatting constructors
* Update API suppressions
* Introduce TextOptions API
* Store BaselinePixelAlignment as byte. Move to a dedicated file.
* Update API suppressions
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Introduce a universal IGlyphTypeface implementation that does not rely on any platform implementation
* Revert changes
* Fix Android
* Make the test happy
* Fix build
* Update baseline
* Fix naming
* Fix headless
* Move interfaces to dedicated files
Make GlyphTypeface.GlyphCount an integer
* Fix GlyphCount
* Make IGlyphTypeface NotClientImplementable
* Make sure we cache platform typefaces by their desired name, style, weight and stretch
* Update baseline
* Only use IGlyphTypeface
* Fix Android
* Try to clear the buffer before we encode somethimg
* Add needed test font
* Add more unit tests
* Reduce allocations
* Remove Direct2D1 test files
* More tests
* More complete table implementations
* More adjustments
* Use batch APIs
* Handle invalid timestamps
* Update baseline
* Introduce a CharacterToGlyphMap struct for faster access
* Remove AggressiveInlining
* Remove AggressiveInlining
* Make the head table optional for legacy fonts
* Remove Load method. Fix TextBlockTests
* Fix nullables
* Remove redundant folder
* Update Api baseline
* revert diff helper changes
* revert changes
* Use bare minimum font for Headless platform and introduce a test font manager that uses the Inter font for testing.
* Add missing font file for Headless platform
---------
Co-authored-by: Gillibald <stebner@avaloniaui.net>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Update ncrunch config.
* Tidy up reflection and multi-binding APIs:
- Move `BindingBase` and `MultiBinding` into Avalonia.Base
- `BindingBase` becomes a true base class for all bindings, and contains only the `Instance` method
- Properties common between reflection and compiled bindings are moved into `StandardBindingBase`
- `Binding` is moved to Avalonia.Base and renamed to `ReflectionBinding`
- A compatibility shim for `Binding` remains in Avalonia.Markup
- Remove `IBinding` and `IBinding2`
- Remove `ITreeDataTemplate's usage of `InstancedBinding`
- Remove `NativeMenuBarPresenter`s usage of `InstancedBinding`
- Remove `InstancedBinding` as it is now unused
This required an update to the DataGrid submodule: cell data validation has been temporarily removed as this used `InstancedBinding`.
* `Instance()` => `CreateInstance()`.
The use of "Instance" as a verb is quite unusual apparently ;)
* Seal classes where appropriate.
* Seal classes where appropriate.
* Remove `StandardBindingBase`.
Simply duplicate the members in reflection and compiled binding classes.
* Delete deleted submodule directory.
* Add missing attribute.
Fixes compile error.
* Fix reference to removed class.
* Update suppressions.
* Improve effect render performance by providing Skia with information about subscene bounds
* Fixed test
* apidiff
* Update API diff
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Improve FontCollection user story
* Make adjustments after review
* Refactor IsFontFile
* Make FontFamilyLoader internal
Make tests happy again
* Update baseline
* Adjust modifier
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Add new SaveFilePickerWithResultAsync API to the base
* Add SaveFilePickerWithResultAsync stub impl
* Control Catalog SaveFilePickerWithResultAsync sample with XML and JSON types
* Make SaveFilePickerResult a struct
* Add managed picker implementation
* Make SaveFilePickerResult a readonly struct
* Windows implementation of SaveFilePickerWithResultAsync
* Test impl for dbus
* Reuse the file type object (FTO) so StorageFile consumer can match exactly the right FTO when receiving the SaveFilePicker's result.
* Add Gtk impl
* Avalonia.Native: surface selected save dialog filters
* macOS: report selected NSSavePanel filter
* Modify the conditional in case there's duplicate descriptions of FTO's in DBusSystemDialog.cs
* Instantiate FPFT as fallback
* Pass the mime/pattern to instantiated FPFT
* Update API diff
* Fix review comments
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* [OSX] Implemented IOSurface/MTLSharedEvent interop APIs
* Bump Xcode?
* Xcode?
* APIDiff
* Use different XCode versions because of how awesome appium is
* A hack for crapium
* Replace SkiaMetalApi usages
* Update API suppressions
---------
Co-authored-by: Timothy Miller <innerlogic4321@gmail.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Retarget to SkiaSharp 3.0
* Replace SKFilterQuality with SKSamplingOptions
* Replace obsolete GRBackendRenderTarget ctor
* Replace SkiaMetalApi reflection with stable APIs
* Use SKMatrix4x4 where it makes more sense perf wise
* Add CS0618 warning as error for Skia
* Fix ToSKSamplingOptions implementation
* Remove hacky compile time condition
* Update API compat
* Remove maccatalyst hack
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Remove PropertyPath.
It was added as part of #2734 with the intention of it being used for animation setters, but this was never implemented. There's no point carrying this old unused code around - if we want to implement this feature we can add it back in.
* Update API suppressions.
* Make `CharacterReader` internal.
And by extension, make the static classes which define extension methods on it internal.
To do this, I had to make Avalonia.Base's internals visible to Avalonia.Designer.HostApp, as that has a dependency on it, and exclude `StringCompatibilityExtensions` from there as the one from Avalonia.Base is now visible.
* Don't expose internals to HostApp.
Exposing Avalonia.Base's internals to Avalonia.Designer.HostApp caused an issue with the dependency on `StringCompatibilityExtensions` - because the hostapp is loaded into the target app and `StringCompatibilityExtensions` is conditionally compiled, you ended up with it being loaded into an app which does not have `StringCompatibilityExtensions`.
Instead, add `string` overloads of the internal APIs which take a `CharacterReader` so that they can be called even when `CharacterReader` isn't available.
* Update API diff.
* Implemented IClipboard.TryGetInProcessDataObjectAsync for X11
* [Win32] Implemented TryGetInProcessDataObjectAsync
* Rest of the platforms
* Run `nuke ValidateApiDiff`
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* fix accelerator behavior for menu items and labels
* add elements with matching accelerator to test cycling in sub menus
* Add AccessKeyHandler tests for accelerators with more than one match
* Implement accelerator behavior based on WPF handling
* Remove commented code
* Remove OnAccessKey override => handled by DefaultMenuInteractionHandler
* remove obsolete test
* handle OnAccessKeyPressed for selected tab item
* fix unit tests
* use AccessKeyEvent instead of AccessKeyPressedEvent in unit tests
* navigate menu with and without ALT key
* Revert formatting changes in Tests
* Fix AccessKeyHandler comments
* move private types to bottom
* Remove lock statements, optimize removal of AccessKeyRegistrations
* remove call to Dispatcher.UIThread.Post
* simplifiy AccessKeyHandler.SortByHierarchy
* remove unnecessary method AccessKeyHandler.GetTargetsForSender
* regenerate API suppression file
* revert unneeded changes in MenuPage.axaml
* correct formatting changes
* do not sort by hierarchy if too few targets
* make AccessKeyEventArgs internal
* make AccessKeyPressedEventArgs internal
---------
Co-authored-by: Hans Docsek <hans.docsek@gmail.com>
* Move automation interfaces to the Avalonia.Win32.Automation with DisableRuntimeMarshalling and use [GeneratedComInterface] marshalling
* Various fixes for the new windows accessibility
* Numerge Avalonia.Win32.Automation into Avalonia.Win32
* Suppress Avalonia.Win32 API warnings, these interfaces never were part of the public API
* Fix IRawElementProviderSimple2 definition on legacy COM interop
* Some changes after review
* More consistent COM method names
* Fix folder hierarchy
* Rewrite SafeArrayMarshaller to use arrays as managed type
* Add ManagedObjectWrapper where's possible
* Throw an exception for unsupported SafeArrayRef scenario
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Show Avalonia context menu and toolip...
In native text box in integration test app. Only implemented for win32 right now.
This is to test the two popup behaviors required for native controls:
- The context menu needs focus to be transferred to Avalonia
- The ToolTip must not transfer focus to Avalonia
* Added Popup.TakesFocusFromNativeControl.
By default, if a popup is shown when a native control is focused, focus is transferred back to Avalonia in order for the popup to receive input. If this property is set to false, then the shown popup will not receive input until it receives an interaction which explicitly focuses the popup, such as a mouse click.
The effect of this property can be seen in the Embedding tag of the IntegrationTestApp: hovering over the native text box shows an Avalonia `ToolTip` which does not steal focus from the native text box. Right-clicking to open an Avalonia `ContextMenu` does steal focus so the menu items can be selected using the arrow keys.
Currently only implemented on a win32.
* Show tooltip and context menu on macOS.
* Implement TakeFocus on macOS.
* Add integration tests.
Only tested on win32 so far.
* Integration tests won't work on macOS.
As can be expected at this point, really.
* Update API diff.
* Implement AvaloniaObject on ResourceProvider
* ColorPaletteResources and ColorPaletteResourcesCollection should inherit ResourceProvider
* Use ResourceProvider in tests too
* Adjust API diff
---------
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
* Mark RenderWorker as internal
* Add remaining Fonts.Tables types as internal
* Mark new diagnostic APIs as a PrivateAPI
* Restore old GetStyleDiagnostics APIs, but mark them with [PrivateApi], avoiding breaking changes
* Add CustomPopupPlacement API
* Add Placement="Custom" support for Flyout, ToolTip and ContextMenu controls as well
* Adjust some API changes
* Add Avalonia.Controls.Primitives.IPopupHost.ConfigurePosition breaking change
* Extract new types into separated files
* Fix build after merge conflict
* Adjust nupkg.xml
* Dispose property subscriptions after popup is closed, avoiding flickering
* Adjust API to be more future proof and add new parameters.
* Add new ContextRequestedEventArgs overload while I am on it
* Bump DBus stack
- Use new Variant system
* Fix merge issues
* Intentionally break the DBus spec
* Dispose DBus connection and signal watchers
* Bump Tmds,DBus.Protocol
* Dispose DBus objects correctly
* Use PathHandler for DBus objects
* Revert to old initialization
* Bump DBus packages
* Fix global menu
* Add comment about wrapped variants
* Bump Tmds.DBus.SourceGenerator
* Update api baseline
* Bump Tmds.DBus stack
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Android screen implementation, using Display API (with some fallbacks)
* Browser screen implementation, aditionally add JSObjectPlatformHandle
* iOS screens API implementation with UIScreenPlatformHandle
* Tizen screens implementation, pretty limited but should be better than nothing
* Reduce some API changes to make them more portable in the future
* Update api suppression
* Added Compositor.CreateCompositionVisualSnapshot API
* Hurr durr api compat in [Unstable] interface
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Draft new API
* Push reusable ScreensBaseImpl implementation
* Fix tests and stubs
* Update ScreensPage sample to work on mobile + show new APIs
* Reimplement Windows ScreensImpl, reuse existing screens in other places of backend, use Microsoft.Windows.CsWin32 for interop
* Make X11 project buildable, don't utilize new APIs yet
* Reimplement macOS Screens API, differenciate screens by CGDirectDisplayID
* Fix build
* Adjust breaking changes file (none affect users)
* Fix missing macOS Screen.DisplayName
* Add more tests + fix screen removal
* Add screens integration tests
* Use hash set with comparer when removing screens
* Make screenimpl safer on macOS as per review
* Replace UnmanagedCallersOnly usage with source generated EnumDisplayMonitors
* Remove unused dllimport
* Only implement GetHashCode and Equals on PlatformScreen subclass, without changing base Screen
* Replace "Active Styles" dev tools analysis with "Active Value Frames"
* Remove old diagnostic methods from public API (breaking change)
* Show full style selectors
* Avoid unnecessary value setters by checking if color was actually changed
* Run UpdateStyles from the dispatcher to fix flickering issue
* Fix build
* Add Close and ClearAll api for INotificationManager
* Remove notification card item on close
* Make _notificationCards readonly
* Clear _notificationCards when detached from visual tree
* Update Avalonia.nupkg.xml
* Use cancellationToken = default instead of null
* Rename ClearAll to CloseAll for consistency with Close method naming
* Remove cancellationToken param from Show method for better compatibility
* Update Avalonia.nupkg.xml
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* Update .NET runtime TypeScript definitions
* Get splash screen by classname instead of ID
* Minimize css usage
* Move insets css properties to JS file
* Refactor browser surface handling, re-enable software renderer, allow fallback render modes
* Extract render timer from the surface, try to reuse compositor instance between avalonia views
* ControlCatalog: Make it possible to set some browser properties (like render mode) from URI arguments
* Rename AppBundle folder to wwwroot
* Extract ITextInputMethodImpl into a BrowserTopLevelImpl
* Extract input into BrowserInputHandler
* Make default surface size 1,1 to match other backends
* Reformat code that I touched (for the most part)
* Why this method even was in public API