Skip to content

Commit

Permalink
Updated for V2
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeYeager2 committed Aug 20, 2021
1 parent 89c5bd1 commit 4486b60
Show file tree
Hide file tree
Showing 18 changed files with 183 additions and 32 deletions.
3 changes: 2 additions & 1 deletion 00-Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ C++ wrapper around the OS's default browser control on Windows, Mac and Linux wh
.NET implementation of the Photino.Native control (beginning with .NET 5). Allows .NET developers to develop .NET applications that host a Photino.Native window for hosting a UI written in HTML/CSS/JavaScript.

### Photino.Blazor
Extension of <span>Photino.</span>NET that adds Blazor functionality to the Photino.Native hosted UI.
Extension of <span>Photino.</span>NET that adds Blazor functionality to the Photino.Native hosted UI.<br>
NOTE: Photino.Blazor is no longer being maintained by this group. We envision it be superceded by .NET 6 and MAUI (Xamarin Forms vNext).

### Photino.Samples
A collection of starter applications for .NET developers that highlights various web UI frameworks and capabilities suitable for learning Photino and for use as starting points for new projects. The installable project templates described are the preferred way to create these samples, though they can also be [downloaded](https://github.com/tryphotino/photino.Samples/archive/master.zip) as .zip files.
Expand Down
5 changes: 2 additions & 3 deletions 00a-QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ $ dotnet run
### Sample Project Templates
The following templates are available and new samples are being added:
* **photinoapp** - basic .NET 5 sample
* **photinotestbench** - test every available setting and option
* **photinoangular** - basic sample with Angular framework
* **photinoreact** - basic sample with React.js framework
* **photinovue** - basic sample with Vue.js framework
* **photino3d** - uses 3.js library to render 3d graphics
* **photino3dreact** - uses 3.js library to render 3d graphics in the React.js framework
* **photinoappwithapi** - make WebAPI calls from UI to application (separate WebAPI project)
* **photinogrpc** - make gRPC calls from UI to application (single project)
* **photinoadvanced** - OS interactions, PowerShell commands and system dialogs
* **photinoblazor** - Blazor UI
* **photinomultiwindow** - create multiple child windows from parent window
141 changes: 141 additions & 0 deletions 00b-WhatsNewInV2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# What's New in V2

## What’s New
* Improved .NET Intelli-sense documentation
* Improved organization of the source code
* Improved ability to add new startup parameters and features in the future
* Improved development experience for configuration for Photino.NET users
* Multi-window support
* Programmatically close native windows
* Most properties can be set before and/or after native window initialization
* Extended fluent methods for initialization and ability to call them after initialization as well
* Handlers can now be established prior to initializing the native window
* Native browser control’s context menu and developer tools access can now be set in code
* New setting to automatically enable permissions for browser control access to local hardware such as camera and microphone without prompting the user
* New settings to use OS default window position and size for native window
* Programmatically set the native browser control’s Zoom level
* Minimize and maximize native windows programmatically
* Center native windows before and/or after initialization
* Chrome-less native windows allows developers to create custom title bars, footers and menus
* Improved support for Full Screen (Kiosk) mode
* Improved support for Topmost (Always on Top) native windows
* Improved logging
* Ability to retrieve values from native windows as well as set them via expanded set of properties

### New Properties
* Centered (bool)
* Chromeless (bool)
* ContextMenuEnabled (bool)
* DevToolsEnabled (bool)
* FullScreen (kiosk mode) (bool)
* GrantBrowserPermissions (bool)
* IconFile (string)
* Maximized (bool)
* Minimized (bool)
* StartupString (string)
* StartupUrl (string)
* TemporaryFilesPath (string)
* Topmost (bool)
* UseOSDefaultLocation (bool)
* UseOSDefaultSize (bool)
* WebMessageReceivedHandler (EventHandler<string>)
* WindowClosingHandler (NetClosingDelegate)
* WindowCreatingHandler (EventHandler)
* WindowCreatedHandler (EventHandler)
* WindowLocationChangedHandler (EventHandler<Point>)
* WindowSizeChangedHandler (EnventHandler<Size>)
* Zoom (int)

### New Methods
* RegisterWindowCreatingHandler()
* RegisterWindowCreatedHandler()
* RegisterWindowClosedHandler()
* SetChromeless()
* SetContextMenuEnabled()
* SetDevToolsEnabled()
* SetGrantBrowserPermissions()
* SetHeight()
* SetLeft()
* SetSize()
* SetLocation()
* SetLogVerbosity()
* SetTemporaryFilesPath()
* SetTitle()
* SetTopMost()
* SetWidth()
* SetZoom()
* SetUseOsDefaultLocation()
* SetUseOsDefaultSize()

### Windows
* The Edge browser control’s temporary files are created in AppData\Local by default and the location can now be set in code.
### Linux
* n/a
### Mac
* n/a


## Bugs Fixed
* WindowClosing event now works properly
* Fixed several issues related to custom schemes (xxx://)

### Windows
* Memory leak injecting JavaScript code
* Now supports multiple windows
* Fixed pixelated window and taskbar icons
### Linux
* Fixed crash when creating multiple windows
### Mac
* Fixed crash when calling SetIconfile()
* Fixed crash on closing

## Breaking Changes
In order to solve some technical issues, we had to make a few breaking changes in V2. The biggest change has been how PhotinoWindow is initialized. The constructor now takes a single parameter; an instance of the parent window if one exists. Properties and/or fluent methods are used configure nearly every setting prior to initialization of the native window and browser control. The only property the developer is required to set is either StartUrl or StartString allowing the native browse control to immediately render the UI. This requirement is necessary to enable multiple window support in Windows as well as provide a better experience for developers. The native window and browser control are automatically initialized and displayed when WaitForClose() is called. Nearly all properties and fluent methods can also be called after initialization of the native window and browser control to change settings at runtime, providing a consistent developer experience.

### Renamed Properties
* IsOnTop --> Topmost

### Renamed Methods
* FullScreen() --> SetFullScreen() (or use FullScreen property)
* Hide() --> Minimize() (or use Minimized property)
* UserCanResize() --> SetResizable() (or use Resizeable property)

### Deprecated Properties
* Children
* WasShown

### Deprecated Methods
* AddChild()
* Dispose()
* RemoveChild()
* Show()

### Other Changes
* PhotinoWindow no longer implements IDsposable
* PhotinoWindowOptions initialization parameter has been removed. Use XXXHandler properties and/or ResgieterXXHandler() fluent methods and/or Events directly instead. Use of RegisterXXHandler() methods is preferred.


### Known Issues
* ShowState() doesn’t pop up in Alert window.

### Windows
* n/a
### Linux
* Access to local hardware from native browser control is not yet supported by the browser control (out of our control)
* Reading the minimized (iconified) state of a native window doesn’t work in GTK 3 (out of our control)
* Calling GetSize() and SetSize() in rapid succession does not work properly. E.g. :<br>
.Height = .Height + 5;<br>
.Width = .Width + 5;<br>
### Mac
* SendWebMessage() is not working (root cause of custom schemes issue as well?)
* .NET Application doesn’t exit when all native windows are closed
* Closing the main window does not close child windows
* Center property and method make window ‘prominent’ per macOS / Cocoa standards and don’t exactly center the window (not a bug)
* Access to local hardware from native browser control is not yet supported by the browser control (out of our control)
* Visual error messages from .Native app not implemented as they are in Windows and Linux
* UseOsDefaultLocation sets location to 0,0 as macOS has no default window location (not a bug)
* UseOsDefaultSize is 800x600 as macOS has no default window size (not a bug)
* ContextMenuEnabled cannot be toggled after initialization as it’s not supported in WKWebKit (out of our control)
* DevToolsEnabled cannot be toggled after initialization as it’s not supported in WKWebKit (out of our control)
* GetScreenDpi always return 72 as it’s not supported on macOS (out of our control)

6 changes: 4 additions & 2 deletions 01-Photino.Native.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Photino.Native is a C++ wrapper around the OS's default browser control on Windo

The source code can be found in a Visual Studio solution in the [GitHub repository](https://github.com/tryphotino/photino.Native). It contains Microsoft C++ code for Windows, gcc C++ code for Linux, and Objective C++ code for Mac as well as code and resources shared in all three environments.

* The Windows code uses the Chromium-based Edge control in [webview2]( https://docs.microsoft.com/en-us/microsoft-edge/webview2/?ranMID=24542&ranEAID=je6NUbpObpQ&ranSiteID=je6NUbpObpQ-T5b4unLww4VC4k9j9e_XIQ&epi=je6NUbpObpQ-T5b4unLww4VC4k9j9e_XIQ&irgwc=1&OCID=AID2000142_aff_7593_1243925&tduid=(ir__jmet23akugkftm1hkk0sohzibm2xpj1pijghddor00)(7593)(1243925)(je6NUbpObpQ-T5b4unLww4VC4k9j9e_XIQ)()&irclickid=_jmet23akugkftm1hkk0sohzibm2xpj1pijghddor00 )
* The Windows code uses the Chromium-based Edge control in [WebView2]( https://docs.microsoft.com/en-us/microsoft-edge/webview2/?ranMID=24542&ranEAID=je6NUbpObpQ&ranSiteID=je6NUbpObpQ-T5b4unLww4VC4k9j9e_XIQ&epi=je6NUbpObpQ-T5b4unLww4VC4k9j9e_XIQ&irgwc=1&OCID=AID2000142_aff_7593_1243925&tduid=(ir__jmet23akugkftm1hkk0sohzibm2xpj1pijghddor00)(7593)(1243925)(je6NUbpObpQ-T5b4unLww4VC4k9j9e_XIQ)()&irclickid=_jmet23akugkftm1hkk0sohzibm2xpj1pijghddor00 )

* The Linux code uses the WebKit-based browser control in [WebKitGTK+2]( https://webkitgtk.org/ ).

Expand All @@ -22,9 +22,11 @@ If you just want to use the Photino.Native component, download or install the [N
## Building
The GitHub repository includes .yml files for automated CI/CD builds, packaging and deployments via Azure DevOps Pipelines. Please refer to these files for the latest information on dependencies and build commands.

The source code also contains a .NET Test project used for testing and troubleshooting. In order to use the Test project, the Photino.NET source code must be downloaded under the same parent folder as the Photino.Native folder (as the Test project does not contain the Photino.NET source code, but rather links to the source in this adjacent folder). If you don't care to use the Test project, there is no need to download the Photino.NET source code.

* **Windows** - Open the solution in Visual Studio 2019 or later with the **Desktop development with C++** workload installed. The **Linux development with C++** workload is recommended, but not required. You *must* build in x64 configuration (*not* AnyCPU which is the default). You *must* install either the [WebView2 runtime]( https://go.microsoft.com/fwlink/p/?LinkId=2124703 ) or the [Edge Dev Channel]( https://www.microsoftedgeinsider.com/en-us/download ). Beta and Canary should work as well, but that hasn't been verified. Just having Edge Chromium installed will not work. The project will build, but will not work properly in a development environment.

* **Linux** - (Tested with Ubuntu 18.04 and 20.04) Install dependencies: `sudo apt-get update && sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev`. <br> To compile, run `gcc -std=c++11 -shared -DOS_LINUX Exports.cpp Photino.Linux.cpp -o x64/$(buildConfiguration)/Photino.Native.so 'pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0' -fPIC`

* **Mac** - Install Xcode. To compile, run `gcc -shared -lstdc++ -DOS_MAC -framework Cocoa -framework WebKit Photino.Mac.mm Exports.cpp Photino.Mac.AppDelegate.mm Photino.Mac.UiDelegate.mm Photino.Mac.UrlSchemeHandler.m -o x64/$(buildConfiguration)/Photino.Native.dylib`.
* **Mac** - Install Xcode. To compile, run `gcc -shared -lstdc++ -DOS_MAC -framework Cocoa -framework WebKit Photino.Mac.mm Exports.cpp Photino.Mac.AppDelegate.mm Photino.Mac.UiDelegate.mm Photino.Mac.UrlSchemeHandler.mm -o x64/$(buildConfiguration)/Photino.Native.dylib`.

5 changes: 3 additions & 2 deletions 02-Photino.NET.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Photino.NET
## Audience
This document is for .NET developers who would like to understand or contribute to the <span>Photino.</span>NET and Photino.Blazor projects. It is a reference implementation of the Photino.Native project for the .NET development platform.
This document is for .NET developers who would like to understand or contribute to the <span>Photino.</span>NET project. It is a reference implementation of the Photino.Native project for the .NET development platform.

## Overview
<span>Photino.</span>NET is a wrapper around the Photino.Native C++ control using the Photino.Native NuGet package. It's purpose is to make it easy for .NET developers to create .NET 5 and later desktop applications using a web (HTML5/CSS/JavaScript) UI that can work cross-platform on Windows, Linux and Mac instead of building OS-specific UIs with technologies like Windows Forms, Windows Presentation Foundation (WPF), Xcode, Swift, or GTK.

If Blazor UIs are desired, please see the Photino.Blazor documentation which builds on <span>Photino.</span>NET.
If Blazor UIs are desired, please see the Photino.Blazor documentation which builds on <span>Photino.</span>NET.<br>
NOTE: Photino.Blazor is no longer being maintained by this group. We envision it be superceded by .NET 6 and MAUI (Xamarin Forms vNext).

The Visual Studio solution source code can be found in the [GitHub repository]( https://github.com/tryphotino/photino.NET ) and you can download a .zip file from there.

Expand Down
1 change: 1 addition & 0 deletions 03-Photino.Blazor.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Photino.Blazor
NOTE: Photino.Blazor is no longer being maintained by this group. We envision it be superceded by .NET 6 and MAUI (Xamarin Forms vNext).
## Audience
This document is for .NET developers who would like to understand or contribute to the Photino.Blazor and <span>Photino.</span>NET projects. It is a reference implementation of the Photino.Native project for the .NET development platform using Blazor.

Expand Down
5 changes: 2 additions & 3 deletions 04-Photino.Samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ If you just want to use the samples projects (not become a contributor), we reco
## Available Samples
The following templates are available and new samples will be added:
* **photinoapp** - basic .NET 5 sample
* **photinotestbench** - test every available setting and option
* **photinoangular** - basic sample with Angular framework
* **photinoreact** - basic sample with React.js framework
* **photinovue** - basic sample with Vue.js framework
* **photino3d** - uses 3.js library to render 3d graphics
* **photino3dreact** - uses 3.js library to render 3d graphics in the React.js framework
* **photinoappwithapi** - make WebAPI calls from UI to application (separate WebAPI project)
* **photinogrpc** - make gRPC calls from UI to application (single project)
* **photinoadvanced** - WebAPI, OS interactions, PowerShell commands and system dialogs
* **photinoblazor** - Blazor UI
* **photinomultiwindow** - create multiple child windows from parent window

## Building
Use standard Visual Studio build procedures for Visual Studio. If you're using the dotnet CLI (with or without VS CODE), use the standard `dotnet restore`, `dotnet build`, and `dotnet run` commands.
14 changes: 8 additions & 6 deletions 05-Photino.VSExtension.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document is for .NET developers using Visual Studio 2019 or later who would
## Overview
The Visual Studio Extension installs project templates for creating the Photino.NET and Photino.Blazor sample projects.

Photino project templates create bare-bones sample applications for various Photino project flavors such as .NET (plain html), Angular, React, Vue, and Blazor. Installing the project templates for Visual Studio 2019, the dotnet CLI and/or VS Code is the easiest way to get up and running creating Photino apps for .NET 5.
Photino project templates create bare-bones sample applications for various Photino project flavors such as .NET (plain HTML), Angular, React, Vue, etc. Installing the project templates for Visual Studio 2019, the dotnet CLI and/or VS Code is the easiest way to get up and running creating Photino apps for .NET 5.

The Visual Studio solution source code can be found in the [GitHub repository]( https://github.com/tryphotino/PhotinoSamples.VSExtension )

Expand All @@ -18,10 +18,11 @@ Open the solution in Visual Studio 2019 or later with the **ASP.NET and web deve

1. Open the Photino.Samples solution [GitHub]( https://github.com/tryphotino/photino.Samples ).
2. Update the samples as required and ensure they build and run correctly.
3. From the Project menu, select Export Template….
4. Select *Project Template*.
5. For each project, enter description as: “Photino.XXX Sample application with XXX UI”.
6. Set icon and preview images if you have them.
3. Make sure to delete any node_modules folders!!!!
4. From the Project menu, select Export Template….
5. Select *Project Template*.
6. For each project, enter description as the description listed in the Samples documentation.
7. Set icon and preview images if you have them.

Zip files are written to:
* C:\Users\xxxx\Documents\Visual Studio 2019\Templates\ProjectTemplates
Expand All @@ -40,6 +41,7 @@ Project templates will now be available on your dev machine and you can copy the

## Upload VSIX Extension to Visual Studio Gallery
* A Photino contributor with account information can sign in to https://marketplace.visualstudio.com with [email protected] Microsoft ID
* Click the “Publish Extensions” link
* Find the extension. Click “manage” link. Click the “…” menu, choose Edit. Click pencil icon next to step 1, Upload new version of the VSIX (created in the bin folder).



Loading

0 comments on commit 4486b60

Please sign in to comment.