How to create your own C ++ - applications with HTML / CSS interface?

Is it possible to develop a C ++ program using HTML and CSS for the user interface? I know about programming with Javascript using the Webkit container, but I am very interested in how to develop C ++.

I felt in love with C # WPF when I was developing under Windows, but now I switched to Linux and I did not find a good tool for using markup for interfaces. For this, I would like to mix HTML and CSS, which are very light and easy to use, with C ++ code, with something like WPF.

Oh, one more thing: I'm looking for desktop development, not web.

+69
c ++ html user-interface css desktop-application
Jul 07 '13 at 23:00
source share
6 answers

Yes it is possible. What you want is a C ++ web framework. You can start by looking at CppCMS , a free high-performance web development platform (not CMS) designed for rapid web application development.

Change After clarifying the question, I think that Awesomium is suitable for your needs.

You can achieve the same functionality by embedding WebKit (or Gecko), but as far as I know, this is exactly what Awesomium does behind the scenes.

An alternative is librocket , a C ++ middleware package designed for gaming applications. As you can guess from the description, it is well suited for games or real-time applications.

+33
Jul 07 '13 at 23:06
source share

Sciter is what is an embedded HTML / CSS engine with the C / C ++ API. Compact and multi-platform.

And check out this article .

Sciter has the same feature set as WPF , but uses HTML / CSS instead of XAML and uses its own API.

Features out of the box:

  • HTML, CSS, SVG, aPNG (animated PNG), image sprites,
  • <plaintext> - editor with syntax highlighting,
  • <htmlarea> - WYSIWYG HTML Editor,
  • <frame type=pager> - print preview and HTML / CSS printing,
  • animation,
  • HTTP client, REST / JSON client, WebSocket, DataSockets,
  • etc..

The same application with the Sciter user interface running on Windows, MacOS and Linux from the same sources:

enter image description here

Disclaimer: I am the author of Sciter Engine.

+33
Nov 06 '15 at 3:13
source share

You can use the Chromium Embedded Framework to embed HTML5 content in your application. You will get all the power and speed of Chromium, and you will be able to create applications with a graphical interface in the same way as you develop web applications.

+7
Dec 20 '16 at 15:36
source share

I think Electron will be a good complement to other answers.

It uses NodeJS to launch a Webkit window. Electron itself is only html / css / js, but you can use any Node module in your Electron application, including your own, compiled C ++ code. A possible module to embed your C ++ code is node-gyp.

Keep in mind, however, that this workflow may include a bit more JS than it would with other answers.

My favorite Atom text editor was created using Electron.

+7
Jul 02 '17 at 22:51
source share

Starting in 2019, I suggest you familiarize yourself with the ultralight HTML user interface mechanism
Not open source, available for C ++. OpenGL and DirectX rendering supported.

Ultralight is an easier and faster way to integrate the HTML interface into your C ++ application.

This was done by the creator of Awesomium, who unfortunately decided to remove Awesomium. This is what we got now.

If you need a heavier weight than light weight, I recommend taking a look at CEF . It is a very powerful (and open source) tool.

+2
Aug 20 '19 at 8:01
source share

You can use WT or CppCMS to parse C ++ in HTML and CSS, then you can use Chromium to turn your project into your own application. But, if I were you, I would save it as a web application, because cloud applications are becoming more and more popular.

-one
Jul 31 '19 at 22:31
source share



All Articles