lc-soft / LCUI

C library for building user interfaces
https://lcui-dev.github.io
MIT License
4.13k stars 356 forks source link

Add WebView #232

Closed niutech closed 2 months ago

niutech commented 3 years ago

Please add a lightweight WebView widget to embed an arbitrary web page in a sandbox, possibly using a native browser engine with webview, Ultralight or Servo. Thanks!

lc-soft commented 3 years ago

Before adding WebView widget, we need to solve the following problems:

  1. How to compile browser engine easily and quickly? The browser engine may have many dependent libraries, and the compilation methods of these libraries are various. We should provide a few simple command lines to make it easier for users to compile it.
  2. How to adapt browser engine? We need to transfer UI events to WebView and present the rendering results of WebView output to the screen. Does WebView provide relevant API support?

If you have used these browser engines, studied its source code, and can provide solutions to these problems, it will be very helpful for the development of WebView widget.

niutech commented 3 years ago

I have used Ultralight (free for non-commercial use and companies with <$100k revenue) and it's very simple to integrate, have a look at the quick start tutorial.

Another option is to use the native platform web engine, see the webview sample - you just have to #include "webview.h" and provide the native window handle in webview_create(int debug, void *window).

niutech commented 2 months ago

@lc-soft What does it mean that it's resolved as completed?

lc-soft commented 2 months ago

@lc-soft What does it mean that it's resolved as completed?

It means rejected. Because I have no plans to add webview support.