diff --git a/.editorconfig b/.editorconfig index ae478b7a9d1..39b8ce3b31f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -123,4 +123,12 @@ indent_size = 4 charset = utf-8-bom insert_final_newline = true trim_trailing_whitespace = true -end_of_line = crlf \ No newline at end of file +end_of_line = crlf + +[**.md] +indent_style = space +indent_size = 4 +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = crlf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6e8458f0bf..35dc78179eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,9 @@ name: Build CI Master on: pull_request: branches: [ master ] + paths-ignore: + - 'docs/**' + - 'specs/**' jobs: build: diff --git a/DevCmd.cmd b/DevCmd.cmd deleted file mode 100644 index f99561fb414..00000000000 --- a/DevCmd.cmd +++ /dev/null @@ -1,19 +0,0 @@ -@echo OFF - -pushd %~dp0 - -set PATH=%PATH%;%~dp0\tools - -call %~dp0\tools\addaliases.cmd - -"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt - -set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt - -call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat" - -pushd %~dp0 - -if '%1%' neq '/PreserveContext' ( - cmd /k -) \ No newline at end of file diff --git a/README.md b/README.md index abff249dbb5..fcc2f452245 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # Project Reunion + +![Build CI Master](https://github.com/microsoft/ProjectReunion/workflows/Build%20CI%20Master/badge.svg) +[![Feature Proposals](https://img.shields.io/github/issues/microsoft/projectreunion/feature%20proposal)](https://github.com/microsoft/ProjectReunion/issues?q=is%3Aissue+is%3Aopen+label%3A%22feature+proposal%22) +[![Bugs](https://img.shields.io/github/issues/microsoft/projectreunion/bug)](https://github.com/microsoft/ProjectReunion/issues?q=is%3Aissue+is%3Aopen+label%3Abug) + ### What is Project Reunion? Project Reunion is our vision for unifying and evolving the Windows developer platform to make it easier diff --git a/docs/README.md b/docs/README.md index d3bfac88e73..ae134f6dc9d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -145,7 +145,7 @@ on the identity + packaging + deployment transparent ideas that Project Reunion supports for your app as well. * **[C++/WinRT](https://github.com/microsoft/cppwinrt)**, -**[RUST/WinRT](https://github.com/microsoft/winrt-rs)**, +**[Rust/WinRT](https://github.com/microsoft/winrt-rs)**, and **[C#/WinRT](https://github.com/microsoft/cswinrt)** provide language-native projections of Windows, Project Reunion, and your own custom types defined in metadata. Consume APIs from @@ -282,4 +282,4 @@ lifecycle and state isolation help get your app ready to run wherever your custo gets us to building a first version of Project Reunion exploring some basic common features. [You can help by filing issues for features you'd like to see](https://github.com/microsoft/ProjectReunion/issues/new/choose)! * [Contributor guide](contributor-guide.md) - How to contribute to Project Reunion. -* [FAQ](faq.md) - frequently asked questions about Project Reunion. \ No newline at end of file +* [FAQ](faq.md) - frequently asked questions about Project Reunion. diff --git a/docs/contributor-guide.md b/docs/contributor-guide.md index 0b67ef7049f..08c976c2aca 100644 --- a/docs/contributor-guide.md +++ b/docs/contributor-guide.md @@ -33,4 +33,12 @@ provided by the bot. You will only need to do this once across all repos using o This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Getting Started + +You'll need Visual Studio 2019 installed to do work in a GUI, or at least the MSBuild and SDK toolchains to build from the command line. From Visual Studio, open the ProjectReunion.sln and hit build! + +Or start a Developer Command Prompt or Developer Powershell for VS 2019, and use ```msbuild /p:configuration=release,platform=x86 projectreunion.sln``` to build. + +If you don't have Visual Studio 2019 or Visual Studio Code installed you can download them [here](https://visualstudio.microsoft.com/downloads/). diff --git a/docs/roadmap.md b/docs/roadmap.md index a3f20452a5c..e00bd25c9de 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,7 +1,13 @@ # Roadmap -Project Reunion is an umbrella of work that we will develop together over time. -Here's how we intend to roll out Project Reunion. +Project Reunion is an umbrella of work that we will develop together over time. + +The roadmap for Project Reunion supports the primary goals of breaking down the barriers between Win32 and UWP and making the Windows developer platform more agile, compatible, modern and open. + +For a general overview, see the [readme](https://github.com/microsoft/ProjectReunion/tree/master/docs) and [FAQ](https://github.com/microsoft/ProjectReunion/blob/master/docs/faq.md). + +Here's how we intend to roll out Project Reunion: + @@ -15,13 +21,12 @@ Here's how we intend to roll out Project Reunion.
  • WinUI preview for UWP & Win32
  • Windows Virtual Desktop
  • WebView2 Preview
  • -
  • GitHub repo for Project Reunion
  • -
  • Engineering in the open
  • +
  • Project Reunion repo
  • @@ -34,4 +39,38 @@ Here's how we intend to roll out Project Reunion. -
      -
    • WinUI Preview for UWP & Win32
    • +
    • WinUI "go-live" Preview
    • Project Reunion Preview
    \ No newline at end of file + + +## 2020-2021 Focus Areas + +The Windows platform team is currently focused on the four primary areas below for Project Reunion. + +This isn't an exhaustive list: it's a sampling of some of the key infrastructure work we're doing to break down the barriers between Win32 and UWP and decouple the platform from the OS, plus some of the new functionality we're adding to enable new app capabilities and address top developer issues. + +### 1. User experience + +* [WinUI 3](https://github.com/microsoft/microsoft-ui-xaml/blob/master/docs/roadmap.md) - the Windows 10 native UI platform for Win32 and UWP +* [WebView2](https://docs.microsoft.com/microsoft-edge/webview2/) - embedding web content in Windows apps using the new Edge (Chromium) engine +* [React Native Windows](https://github.com/microsoft/react-native-windows/projects/30) - now targeting WinUI + +### 2. Hardware light-up and delighters + +* Touch, inking, display improvements + +### 3. Platform fundamentals + +* [Better options for app lifecycle management and power usage](https://github.com/microsoft/ProjectReunion/issues/111) +* [DirectWrite text rendering platform](https://github.com/microsoft/ProjectReunion/issues/112) +* Windowing [details forthcoming] + +### 4. Platform unification and deployment + +* Decoupling the Windows platform from the OS + * faster updates that you can start using on day 1 +* Ensuring features work on all supported Windows versions + * initial min OS version = 1809 + * polyfilling features as needed + * supporting both Win32 and UWP + +* Moving engineering to GitHub + * [Proposals](https://github.com/microsoft/ProjectReunion/issues?q=is%3Aissue+is%3Aopen+label%3A%22feature+proposal%22) -> [Specs](https://github.com/microsoft/ProjectReunion/tree/master/specs) -> [Code](https://github.com/microsoft/ProjectReunion/tree/master/dev) diff --git a/specs/Picker-API_spec.md b/specs/Picker-API_spec.md index dee1e8d9074..5051aa8bd4d 100644 --- a/specs/Picker-API_spec.md +++ b/specs/Picker-API_spec.md @@ -1,68 +1,182 @@ # Background -The current FilePicker API for UWP has several limitations. Some of the top limitations +The current FilePicker API for UWP has several limitations. Some of the top limitations are as described below: **1. Unable to pick files and folders in a single instance of the Picker dialog** - The Picker dialog allows developers to specify picker mode to be single file or multiple - files. It does not however, allow developers to specify a mode to pick both files and folders. - There has been feedback indicating that this behaviour is limiting, requiring developers - to build their own picker experience. +The Picker dialog allows developers to specify picker mode to be single file or multiple +files. It does not however, allow developers to specify a mode to pick both files and folders. +There has been feedback indicating that this behaviour is limiting, requiring developers +to build their own picker experience. **2. Unable to pick multiple folders.** - The Picker dialog (FolderPicker) does not allow users to pick multiple folders. The developer - experience currently is to select a single folder and repeat the dialog for more folders. This - is a less than ideal experience for application developers. +The Picker dialog (FolderPicker) does not allow users to pick multiple folders. The developer +experience currently is to select a single folder and repeat the dialog for more folders. This +is a less than ideal experience for application developers. **3. Unable to specify an arbitrary start location for the picker.** - The existing File/Folder pickers do not allow the developer to specify an arbitrary start location (even if the app has access). Currently, the start location is limited to a set of predefined enum values. +The existing File/Folder pickers do not allow the developer to specify an arbitrary start location +(even if the app has access). Currently, the start location is limited to a set of predefined enum +values. The Reunion picker dialog addresses the above issues. This Reunion API will be based upon the below -APIs in the Windows SDK. The Reunion Picker API will remove the deprecated APIs and add additional methods -for the functionality: File and folder picker, Multiple folder picker. +APIs in the Windows SDK. The Reunion Picker API will supercede the existing APIs and add additional +methods for the functionality: File and folder picker, Multiple folder picker. -- Windows.Storage.Pickers.FileOpenPicker (https://docs.microsoft.com/en-us/uwp/api/Windows.Storage.Pickers.FileOpenPicker) -- Windows.Storage.Pickers.FileSavePicker (https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.filesavepicker) -- Windows.Storage.Pickers.FolderPicker (https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.folderpicker) +- [Windows.Storage.Pickers.FileOpenPicker](https://docs.microsoft.com/en-us/uwp/api/Windows.Storage.Pickers.FileOpenPicker) +- [Windows.Storage.Pickers.FileSavePicker](https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.filesavepicker) +- [Windows.Storage.Pickers.FolderPicker](https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.folderpicker) # Description -The goal of this API is to address the gaps in the existing File/Folder picker APIs. The API surface is similar to the existing -Picker APIs in Windows SDK with additional methods to support File + Folder picker and multiple folder picker. The Project Reunion APIs will supercede the Windows APIs. +The goal of this API is to address the gaps in the existing File/Folder picker APIs. The API +surface is similar to the existing Picker APIs in Windows SDK with additional methods to support +File + Folder picker and multiple folder picker. The Project Reunion APIs will supercede the +Windows APIs. # Examples -## Show file and folder picker - ```c# + +## Show file and folder picker to pick images with specified extension + +```c# var picker = new StorageItemPicker(); - picker.FilterAndDescription.Insert("Images", "*.jpg, *.png"); + picker.FiltersAndDescriptions.Insert("Images", "*.jpg, *.png"); picker.StartLocation = startLocation; - picker.PickableKinds = StorageItemPickerKinds.Folder | StorageItemPickerKinds.File; - IReadOnlyList storageItems = await picker.PickMultipleItemsAsync(); + picker.PickerKinds = StorageItemPickerKinds.Folder | StorageItemPickerKinds.FileOpen; + StorageItemPickerResult result = await picker.ShowPickerAsync(); - if(0 < storageItems.Count) + if(result.PickerResult == 0) { + foreach(var storageItem in result.PickedItems) + { + if(storageItem is StorageFile) + { + IList contents = await FileIO.ReadLinesAsync(storageItem); + + foreach(String content in contents) + { + System.Diagnostics.Debug.WriteLine(content); + } + } + else + { + System.Diagnostics.Debug.WriteLine(storageItem.Name); + } + } } - ``` -## Show single folder picker - ```c# + else + { + StringBuilder stringBuilder = new StringBuilder("ShowPicker failed with hr:"); + stringBuilder.Append(result.PickerResult); + System.Diagnostics.Debug.WriteLine(stringBuilder.ToString()); + } +``` + +## Pick folders + +```c# var picker = new StorageItemPicker(); picker.PickerKinds = StorageItemPickerKinds.Folder; - Windows.Storage.IStorageItem folder = await picker.PickSingleItemAsync(); - ``` -## Show multi folder picker - ```c# + StorageItemPickerResult result = await picker.ShowPickerAsync(); + + if(result.PickerResult == 0) + { + var selectedFolder = result.PickedItems[0]; + System.Diagnostics.Debug.WriteLine(selectedFolder.Name); + // Other folder operations + } + else + { + StringBuilder stringBuilder = new StringBuilder("ShowPicker failed with hr:"); + stringBuilder.Append(result.PickerResult); + System.Diagnostics.Debug.WriteLine(stringBuilder.ToString()); + } +``` + +## Pick multiple folders for access + +```c# var picker = new StorageItemPicker(); picker.PickerKinds = StorageItemPickerKinds.Folder; - IReadOnlyList folders = await picker.PickMultipleItemsAsync(); - ``` + picker.MultiSelect = true; + StorageItemPickerResult result = await picker.ShowPickerAsync(); + + if(result.PickerResult == 0) + { + foreach(var folder in result.PickedItems) + { + System.Diagnostics.Debug.WriteLine(folder.Name); + } + } + else + { + StringBuilder stringBuilder = new StringBuilder("ShowPicker failed with hr:"); + stringBuilder.Append(result.PickerResult); + System.Diagnostics.Debug.WriteLine(stringBuilder.ToString()); + } +``` + +## Pick multiple files and specify a start location + +```c# + var picker = new StorageItemPicker(); + picker.StartLocation = @"%userprofile%\foldername"; + picker.MultiSelect = true; + picker.PickerKinds = StorageItemPickerKinds.FileOpen; + StorageItemPickerResult result = await picker.ShowPickerAsync(); + + if(result.PickerResult == 0) + { + foreach(var file in result.PickedItems) + { + System.Diagnostics.Debug.WriteLine(file.Name); + System.Diagnostics.Debug.WriteLine(file.Path); + } + } + else + { + StringBuilder stringBuilder = new StringBuilder("ShowPicker failed with hr:"); + stringBuilder.Append(result.PickerResult); + System.Diagnostics.Debug.WriteLine(stringBuilder.ToString()); + } +``` + +## Show File Save picker starting at custom location + +```c# + var picker = new StorageItemPicker(); + picker.StartLocation = @"%userprofile%\folder"; + picker.PickerKinds = StorageItemPickerKinds.FileSave; + StorageItemPickerResult result = await picker.ShowPickerAsync(); + + if(result.PickerResult == 0) + { + var saveFile = result.PickedItems[0]; + if(saveFile != null) + { + await FileIO.WriteTextAsync(saveFile, "Picked from FilePicker"); + } + } + else + { + StringBuilder stringBuilder = new StringBuilder("ShowPicker failed with hr:"); + stringBuilder.Append(result.PickerResult); + System.Diagnostics.Debug.WriteLine(stringBuilder.ToString()); + } +``` + # Remarks + # API Notes +The ShowPickerAsync method must be invoked on the UI thread + # API Details - ```c# - namespace Microsoft.Reunion.Storage.Pickers + +```c# + namespace Microsoft.Storage.Pickers { enum PickerViewMode { @@ -74,30 +188,36 @@ Picker APIs in Windows SDK with additional methods to support File + Folder pick enum StorageItemPickerKinds { - File = 0x1, - Folder = 0x2 + FileOpen = 0x1, + Folder = 0x2, + FileSave = 0x4 }; + runtimeclass StorageItemPickerResult + { + Windows.Foundation.Collections.IVectorView PickedItems{ get; }; + Int64 PickerResult{ get; }; + } + runtimeclass StorageItemPicker { StorageItemPicker(); /// Properties - String StartLocation; - String CommitButtonText { set; } - String CancelButtonText { set; } - Windows.Foundation.Collections.IMap FilterAndDescription{ get; } - PickerViewMode ViewMode; + String StartLocationFolderPath; + String CommitButtonText; + String CancelButtonText; + Windows.Foundation.Collections.IPropertySet FiltersAndDescriptions{ get; }; + ViewMode DefaultViewMode; StorageItemPickerKinds PickerKinds; - String SuggestedSaveFile; + String SuggestedFileName; String DefaultFileExtension; + Boolean MultiSelect; /// Methods - Windows.Foundation.IAsyncOperation PickSingleItemAsync(); - Windows.Foundation.IAsyncOperation> PickMutipleItemsAsync(); - Windows.Foundation.IAsyncOperation PickSaveFileAsync(); + Windows.Foundation.IAsyncOperation ShowPickerAsync(); } } - ``` +``` -# Appendix \ No newline at end of file +# Appendix