* support reading images from clipboard(win32/android)
* Add DataFormat.Image. Prioritize png format when retrieving image from clipboard
* add browser support
* addressed comments
* win32 - add support for CF_DIB and CF_BITMAP formats
* win32 - add support for copying bitmaps to clipboard as DIB
* browser - add support for copying bitmap to clipboard
* Implement bitmap clipboard for iOS
* rename DataFormat.Image to DataFormat.Bitmap
* Implement Bitmap clipboard on macOS
* Use MemoryStream for bitmap clipboard/dnd on macOS backend
* Add public.jpeg support on macOS backend (convert it to png while in objc)
* Support TIFF format on iOS backend, by converting it to UIImage first
* Add Bitmap DND sample
* add clipboard bitmap support on linux
* simply bitmap format search on win32 clipboard
* fix linux clipboard image
* Bump MACOSX_DEPLOYMENT_TARGET
* Fix IDL incompatibility
* address review
* more reviews
* Fix Android crash on copy when a bitmap is present in the clipboard
* Handle any error that might occur pasting from an external content provider
* Add data transfer extension methods for Bitmap
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Add Impl for SaveFilePickerWithResultAsync API (#19783)
* 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>
(cherry picked from commit 2c540873ec)
* api diff update
* dummy up tizen
* [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>
(cherry picked from commit 22c4c630ce)
* IsEditable combox box with text bindings
* Update after #18405 api review
* ComboBox tests for IsEditable
* remove unneeded error being throw when combox is editable and doesn't have text binding properties
* Changes after code review
* only do naviagtion check if combo box is editable
* Fix editable ComboBox tab navigation
* combobox code review improvements
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
(cherry picked from commit 105ba1aa42)
* add SplitViewPanePlacement settings for Top and Bottom.
* remove duplicated styles.
* add missing transparent fills of lightdismiss area.
* add simple theme support for splitview pane placement top/bottom.
* Add unit test for all color format Brush parsing
* Support parsing all known color formats in Brush.Parse()
* Update property syntax
* Remove unnecessary usings
* Use an actual hex color
* Fix new brush test
* Switch order of brush parsing so known color optimizations are used
* Add more documentation comments to KnownColors
* Fix displayed text in BorderPage
InnerBorderEdge not InnerBorder
* Added failing test for OSXThickTitleBar single title area click produce double click #19320
* Fixed OSXThickTitleBar title area click duplication and event delays until the event-tracking-loop is completed
* IntegrationTestApp. Move event counter controls to a separate column. Fixes Changing_Size_Should_Not_Change_Position test
* Move pointer tests to Default group to avoid interference
* Try to fix CI crash
* Try disabling test
* Fix CI test. Collection back to Default
* CI fix. Return back empty test.
* CI fix. Minimal bug test
* CI test. Add double click test
* CI fix. Remove double click test.
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Add CanMinimize and CanMaximize to Window
* Win32 impl for CanMinimize/CanMaximize
* Add CanResize/CanMinimize/CanMaximize samples to control catalog
* X11 impl for CanMinimize/CanMaximize
* macOS impl for CanMinimize/CanMaximize
* Win32: don't allow restore when the window isn't resizable
* Additional documentation for CanMinimize/CanMaximize
* Add CanMinimize/CanMaximize logic to CaptionButtons
* Use START_COM_ARP_CALL
* Added CanMinimize/CanMaximize integration tests
* Fixed CanMaximize tests on macOS
* Added failing test for OSXThickTitleBar drag events outside thick title area
* MacOS. Added event tracking loop for drag events started in thick titlebar (NSToolbar)
* Review fix: forward events to AppKit during tracking loop (#19320)
* Only start ScrollGesture when left click pressed, also `GetCurrentPoint(null)` behaves the same as root visual
* Allow right-click pen to select items on press
* Add context menus to even items on ListBox page for testing
* Avoid global static in UpdateSelectionFromPointerEvent
* Revert "Avoid global static in UpdateSelectionFromPointerEvent"
This reverts commit 2562d73e83.
* Add comment to UpdateSelectionFromPointerEvent
* Use fully mocked rendering for list box test
* Add pen selection tests
* TouchTestHelper should use correct inputs
* Implemented IClipboard.TryGetInProcessDataObjectAsync for X11
* [Win32] Implemented TryGetInProcessDataObjectAsync
* Rest of the platforms
* Run `nuke ValidateApiDiff`
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Fix XamlTypeExtensionNode not being handled on the x:DataType transformer
* Add testt with complex DataType
* Make vm:MainWindowViewModel+TestItem nested type generic on BindingDemo
* Added new test: changing window size should not change position
* Removed unnecessary window placement assignment to fix window position shifting due to incorrect workspace coordinate usage
* Fixed test because buttons went off the window on tiny screen resolutions
* Make test Windows specific
* Use `Bounds` instead of `Width` and `Height` properties as they are "requested" size rather than actual size (see #18060)
* 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>
Changed the adapter index in the for loop to correctly iterate through available adapters. This ensures that the correct adapter is selected based on its Luid.
* 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>
* Do not reset the selected range when the TextBox loses focus
Do not render selection highlight when the TextBox doesn't has focus
* Invalidate TextLayout when the focus is lost
* Make ClearSelectionAfterFocusLost optional
Make inactive selection highlight optional
* Make sure changes to ShowSelectionHighlight invalidate the visual and text layout
* Implemented GLib-based dispatcher
This should allow running Avalonia on the same thread as another UI toolkit that supports running on top of GRunLoop (e. g. GTK)
* Force-drain the X11 event queue, since g_runloop_quit won't exit the loop otherwise
* 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.
* 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
* Added Compositor.CreateCompositionVisualSnapshot API
* Hurr durr api compat in [Unstable] interface
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
Toggling the window decorations can cause the window to be moved off screen, causing integration test failures. Until this bug is fixed, detect this and move the window to the screen origin. See #11411.
* Added embedding page to IntegrationTestApp.
Currently embeds a lone native text box, and only when running on Windows.
* Win32 automation support for native control host.
Allows native controls to appear in the Avalonia automation tree as a child of the `NativeControlHost`. They also appear in the _wrong_ place - as a direct child of the `Window` - but this appears to be expected behavior as it happens when hosting a win32 control in WPF as well.
* Basic native control integration test on win32.
* Test editing native win32 control in popup.
* Add embedded text box on macOS.
* macOS automation support for native control host.
Implements special-casing of `InteropAutomationPeer`on macOS.
* Make native control integration test work on macOS.
The test for the native control in a popup is disabled on macOS because we have a bug there.
* Add missing parts
* Fix build error
* Skip test to see if CI passes again.
* Log more info about integration tests on win32.
* Try to fix flaky test.
* The tests won't yet work on macOS yet.
Will require #16577.
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Refactor IntegrationTestApp.
Use a `ListBox` to switch pages instead of a `TabControl`: the `TabControl` didn't adapt well to smaller screen sizes, and the `MainWindow` was getting unwieldy anyway.
* Update tests to use new pager.
Move logic for selecting the page to a base class as we may need to handle scrolling manually on macOS at some point (Appium on macOS doesn't scroll elements into view automatically).
* Add AutomationPeer.IsOffscreen.
This is needed in order for controls to be scrolled into view using WinAppDriver. The default is the same as WPF and the default value is overridden in the same controls as WPF (where present).
When opening a context menu and pressing the "arrow down" key, the first menu item was not selected. This issue was introduced by #11287. The fix is to make the `ContextMenu` focusable.
Added an integration test to try to prevent regressions.
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Set isDirectory:true explicitly to help [NSURL fileURLWithPath] method
Might solve some rare/random issues with initial directory not being applied
* Fix dialogs page incorrectly setting parent folder
* Move SecurityScopedStream out of iOS project and share it with macOS project
* Refactor BclStorageItem to be more reusable across platforms
* [Breaking] Set BclStorageItem.CanBookmark to false, as it never was supposed to be true. Plain BCL doesn't provide files bookmarking.
* Reimplement storage provider support on macOS, support (optional) sandboxing
* Fix build
* Fix AppSandboxEnabled=false usage
* Re-enable BCL bookmarks, keep them base64
* Fix nullable error
* Prefix all bookmarks with a platform key
* Fix devtools breaking sandboxed app
* Try to read errors after saving bookmark
* Don't crash sample app if has no access
* Add internal IStorageItemWithFileSystemInfo abstraction
* Log information if OpenSecurityScope returned false
* Fix build
* Prefix bookmarks with "ava.v1."
* Support opening old-style bookmarks to avoid breaking changes