Giter VIP home page Giter VIP logo

photino.native's Introduction

Hello Photino Community! We have a new poll question, regarding where and how you use Photino:

PHOTINO USAGE POLL

Build native, cross-platform desktop apps

Photino is a lightweight open-source framework for building native,
cross-platform desktop applications with Web UI technology.

Photino enables developers to use fast, natively compiled languages like C#, C++, Java and more. Use your favorite development frameworks like .NET 5, and build desktop apps with Web UI frameworks, like Blazor, React, Angular, Vue, etc.!

Photino uses the OSs built-in WebKit-based browser control for Windows, macOS and Linux. Photino is the lightest cross-platform framework. Compared to Electron, a Photino app is up to 110 times smaller! And it uses far less system memory too!

Photino.Native

Clone and contribute to this project if you would like to expand and enhance the core functionality of Photino. The native C++ projects handles system calls and exposes native OS operations to the parent Photino .NET 5 wrapper, which can be found here: https://github.com/tryphotino/photino.NET If you would like to bring photino into another, currently not supported environment OS, or provide support for other languages such as Java, Rust, or Go, you will also likely need to build this repo.

All features contributed to the Photino.Native project require implementation for Windows, macOS, and Linux.

In all other cases you will probbaly not need the source code for this project, but instead should add and consume this library through its Nuget Package: https://www.nuget.org/packages/Photino.Native/

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.

  • 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 or the Edge Dev Channel. 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 libnotify-dev. 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 libnotify' -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.mm -o x64/$(buildConfiguration)/Photino.Native.dylib.

photino.native's People

Contributors

jammerxd avatar jinshil avatar mikeyeager avatar mikeyeager2 avatar mynameisvasco avatar neil-coretainium avatar neil-hyd avatar ottodobretsberger avatar philippjbauer avatar raxdiam avatar vvollers avatar xaevman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

photino.native's Issues

Let the OS position window initially

If not set, the initial window position is set to 0,0. There default should be to let the OS position the window initially. Perhaps setting to -1,-1?

macOS: input tag does not open file picker

To reproduce, using the default photinoapp application, place the following in the default index.html file:

  • Run
  • Press "Choose File" button

Result: Nothing happens
Expected: File picker to open

macOS Catalina - 10.15.7

Verified this works as expected on Windows. Also it fails with a Xamarin.Mac app with an embedded WKWebView, so I'm thinking it's either impossible, or the WKWebView is not being created with the proper security context (which for the life of me can't figure out how to change). Opening the index.html file in macEdge or Safari also works as expected.

Linux code is not Linux-specific?

Looking at the Linux code, I don't see anything that is not portable to any *NIX system with X11. Why is it guarded with #ifdef __linux__?

Add Window Management

Can we separate the application thread from the PhotinoWindow instances to implement a (basic) window management system?

Currently a developer has to come up with something themselves. This might not be trivial for many. It would be great if we can develop a window management API.

Does it make sense to leave this as the .NET level?

Add fullscreen control to window API

The full screen parameter in the window constructor doesn't maximize the window, it makes the browser control full screen. This might be right in some situations, but there should be a way to make the window appear maximized.

Native menu support

Allow user to manipulate OS menu
By passing in JSON for initialization
Still need an API to add, remove, disable, etc.

Photino.HelloPhotino.AdvancedNET crashes with undefined symbol: basic_ostringstream

On Ubuntu 18.04, Photino.HelloPhotino.AdvancedNET sample (and others), clicking the "Call .NET via text passed to a memory buffer" button causes an app crash. The Photino window disappears and in the terminal the app prints:

/tmp/photino.Samples/Photino.HelloPhotino.AdvancedNET/bin/Debug/net5.0/HelloPhotino.AdvancedNET: symbol lookup error:
/tmp/photino.Samples/Photino.HelloPhotino.AdvancedNET/bin/Debug/net5.0/runtimes/linux-x64/native/Photino.Native.so: 
undefined symbol: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev

Demangling the undefined symbol:

std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()

Improve JavaScript Interop SDK

Currently everything is in the window namespace.

Move the JavScript text to a shared .h file? Make it a .js file that can be embedded in the native file?

Native Menu Support

Allow user to manipulate OS menu
By passing in JSON for initialization
Still need an API to add, remove, disable, etc.

Navigating after WaitForClose() is called, crashes app

A view can be loaded (e.g. "wwwroot/index.html") and will be displayed when WaitForClose() was called. If a navigation method (e.g. Load()) is called afterwards, the application crashes without error.

Confirmed on macOS at this point.

RegisterWindowClosingHandler not working on linux (Debian)

I succesfully ported small winform application as a multiplatform desktop app running under Photino.
With one exception - RegisterWindowClosingHandler works on the windows, but not works on the linux.
When I click on the X (close icon on the toolbar), „closing event“ is not fired and when I close the child window (with X), whole application is closed. On the windows it works as expected.

WebKit?

Hi there :-)

Pleased to see this effort, thank you for that!

A quick question, as I stumbled over it in the docs:
"Photino uses the OSs built-in WebKit-based browser control for Windows, macOS and Linux"

Which WebKit-based OS browsers do we have in Windows and Linux?

Cheers!
-Christian

System.DllNotFoundException on Linux (NixOS)

Similar to Add support for Linux ARM64#17, there seems to be missing native dependencies of WebkitGTK on some linux distributions which leads to the System.DllNotFoundException error. @srid has reported this similar issue on the template repository I created for F#

What could users do about this?

  • Show a message telling them to install the native dependencies?
  • Option to package the dependencies with the assemblies for these unsupported distributions?

According to the docs, they mention how these dependencies are always available but there seem to be some exceptions to that. Maybe adding a section of specific platform support would be greatly appreciated

  • The Windows code uses the Chromium-based Edge control in webview2
  • The Linux code uses the WebKit-based browser control in WebKitGTK+2.
  • The Mac code uses the WebKit-based browser control in WKWebView.

Because these controls are always included on Windows and Mac and are usually included in Desktop Linux builds, there is no need to download or install the controls along with the application, making Photino applications lean and performant.

Toggle Maximized Method

There is no way to programmatically toggle the Maximized mode of the window. (Windows, Mac and Linux)

Maximized can't be called through the constructor method either at the moment.

Native Menu Support

Allow user to manipulate OS menu
By passing in JSON for initialization
Still need an API to add, remove, disable, etc.

Remove file path from alert windows

The alert windows that are triggered from JavaScript show the current file path from the sender window. This needs to be replaced by user configured or default titles. Defaults for now.

Vertical position not set correctly

Even though there is some code that should set the Y-position correctly it doesn't work and I had to recalculate the position in the PhotinoWindow API. Perhaps the comment in the GetPosition method and the implementation are not accurate after all and macOS uses the top-left corner instead of the bottom-left corner now?

"It will be negative, because macOS measures from bottom-left. For x-plat consistency, we want increasing this value to mean moving down." - Unknown

Close Window Method

Closing callback is commented out of the event loop because it causes a crash.

Compare to webview

Out of curiosity, how does this project compare to webview. I'm mostly investigating this as an alternative, since webview development has stalled.

One thing this project doesn't seem to have is "embedding" a browser window or using it as a widget. That is, unless I'm missing something obvious.

Windows x86

Hi, this is really an interesting project. We're currently evaluating it for our use case (.net core).
Currently on windows there's only native deps for x64. Do you plan to add support for windows x86 as well?

Opening multiple windows causes crash on Linux

Hi there folks, I was trying to combine an Avalonia linux app (https://avaloniaui.net) and use Photino as an embedded browser. I can start one instance of the Photino window and it works fine. However, when I close the window and try to open a new one, the entire app crashes with no stack trace. I've debugged the issue to be something in the C++ native Linux code, but all my attempts at solving the issue in C++ have not been successful. I'd greatly appreciate any ideas you may have in fixing this. Thanks for the great work!

Add default window icon

There should be a way to set the window icon initially, so it's displayed when the window is shown.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.