Cross-platform Chromium-based GUI framework for C++ apps

Discussion of current events and participation in intelligent conversation with other CEF users.

Cross-platform Chromium-based GUI framework for C++ apps

Postby Fedorov » Wed Feb 14, 2018 9:30 am

I'm looking for a simple, unified GUI for my C++ projects, that will work on all major desktop and mobile platforms.
I've been using QT for a while, but being impressed by JavaScript, HTML5 and
Chromium, I'd like to use that technology in my projects.
Please, pardon me my naive thoughts, I'm completely new to Chromium and CEF, but here is what I think.

* Chromium is free and open-source, it runs on Windows, Linux, Mac, Android and iOS.

* One can create his own Chromium based project,
add some portable C++ logic and expect that the whole will work on the above mentioned platforms.

* To reduce time, complexity and to improve usability,
the "heavy artillery" can be compiled to binaries,
and an accompanying template project (a wizard) can be created for MSVC, MinGW, XCode.
Thus, a C++ programmer can immediately start work, not distracting for such things
as compiling core, resolving dependencies, managing third-party licenses etc.

* To be usable, a very simple functionality is required and should be offered by the template project:
* Dynamic html and javascript loading from C++
* A very basic data exchange functions, something like
dispatchToCpp(data), onCppDataReceived(data) for JavaScript,
and dispatchToJS(char* data, int length), onJSDataReceived(char*data, int length) for Cpp;



This is how the situation looks for a guy, who sees only the top of the iceberg. I realise, that if
such a framework doesn't yet exist, there must be a reason: technical, legal, or of other kind.
I'd appreciate very much if a professional who knows Chromium, explains that reason, or writes
a short comment about possibility, difficulty or necessity of such a framework. You will save a lot
of time for me and others like me, who otherwise have to make a research to find the answers.
Thanks in advance.
Fedorov
Newbie
 
Posts: 2
Joined: Wed Feb 14, 2018 9:25 am

Re: Cross-platform Chromium-based GUI framework for C++ apps

Postby magreenblatt » Wed Feb 14, 2018 11:35 am

You can already make a HTML/JS web app that runs in a browser on all platforms (be it CEF, Edge, Chrome/WebView or Safari/WebView). Most platforms also already provide a way to wrap a browser control in what appears to be a "standalone app" for installation purposes. What native/C++ functionality do you require on each platform? This is where the complexity begins. Depending on your answer there may already be an existing/proposed HTML5 API (the easiest solution), you may need a custom/proprietary native library, or you may need to write native code in an OS-specific language (ObjC on macOS/iOS, Java on Android, .Net on Windows, etc). It's unlikely that an API/toolchain from a single vendor can ever support all of these use cases (nor would they want to spend the development resources), so instead you need to plug into the existing APIs/toolchains on each platform. To make the tooling convenient and easy to use you'll need to work inside of a development environment that runs on each developer's preferred OS (Windows, macOS or Linux).

Now, what would it take to get everyone using a single product across all development platforms? Cross-compilers and emulators exist for most platforms (clang/llvm, etc), so it's not particularly difficult from a tooling perspective. Instead, you find yourself with a sociology problem. Each developer has their preferred GUI/development tools and they generally resist change to a less capable environment. So, if you want to create a single product for all platforms, you need to either (a) plug into all of the most popular development environments, or (b) convince developers to use the same development environment on all platforms. I'm not a big fan of (a) because of the scope and likely necessity of separate UI implementations for each environment (lots of testing/support headaches). On the other hand, implementing (b) is costly and likely requires the support from a large/dedicated company. The only company that so far seems interested in solving (b) is Microsoft -- look at what they've been doing the last few years with Visual Studio. You can already use it for development on most platforms (via Visual Studio Code), and it currently ships with iOS/Android emulator support.

It seems therefore that the most reasonable/least-cost solution would be a plugin for Visual Studio that shares the same UI across all platforms and triggers the appropriate "standalone app" packaging steps for each platform using the browser type and tooling most appropriate to that platform. This plugin may already exist for some platforms (everyone re-inventing the wheel for their favorite platform) and in those cases perhaps it could just be re-branded/standardized/documented by a single entity. Maybe Microsoft will do it, or maybe some other company or open source project will come along. It would be a good project if you're looking for one :)
magreenblatt
Site Admin
 
Posts: 8538
Joined: Fri May 29, 2009 6:57 pm

Re: Cross-platform Chromium-based GUI framework for C++ apps

Postby Fedorov » Wed Feb 14, 2018 4:02 pm

Thank you very much for your reply, Marshall. It's a pleasure to receive an answer from the forum administrator and CEF developer.
magreenblatt wrote:It's unlikely that an API/toolchain from a single vendor can ever support all of these use cases (nor would they want to spend the development resources), so instead you need to plug into the existing APIs/toolchains on each platform. To make the tooling convenient and easy to use you'll need to work inside of a development environment that runs on each developer's preferred OS (Windows, macOS or Linux).


There is already such an IDE (or something close to it): Qt Creator. It's free, easy to use, familiar to me, and it works fine for desktop platforms. So, one solution is to write a wizard for Qt Creator, that creates a cross-platform CEF-based C++ project for Windows, Linux and Mac. As for Android and iOS, it's different. Even though Qt Creator supports them, this support is limited and often lacks documentation. So, at the moment better choice is to use Android Studio and XCode, imo. 3 IDEs in total, not perfect but acceptable.

magreenblatt wrote:It seems therefore that the most reasonable/least-cost solution would be a plugin for Visual Studio

magreenblatt wrote:It would be a good project if you're looking for one :)

I'd be better for me to start with Qt Creator. As for MSVS, maybe somebody with greater skills can do that.
Fedorov
Newbie
 
Posts: 2
Joined: Wed Feb 14, 2018 9:25 am

Re: Cross-platform Chromium-based GUI framework for C++ apps

Postby magreenblatt » Wed Feb 14, 2018 4:29 pm

You'll probably want to (eventually) support multiple IDEs to reach the largest number of developers. If Qt Creator is most familiar/useful for you then I'd say it's a good starting point. Implementing support for 1 IDE x 3 desktop platforms should be enough combinations to prove out the initial concept. Given the form factor differences between desktop and mobile devices you may find that the configuration UI targeting desktop platforms needs to be significantly different from the UI targeting mobile platforms in any case.
magreenblatt
Site Admin
 
Posts: 8538
Joined: Fri May 29, 2009 6:57 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests