News for hackers. Stuff that matters.
Re:C++ Lightweight, cross-platform, HTML rendering engine fo... by jakearmitage on Friday August 28, 2020 @09:05AM (#24304352)
Uh... yes you can:

  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create("");

  Gtk::Window window;
  window.set_default_size(1366, 768);

  WebKitWebContext* context = webkit_web_context_new_ephemeral();
  WebKitCookieManager* cookies = webkit_web_context_get_cookie_manager(context);

  WebKitWebView* widget = WEBKIT_WEB_VIEW(webkit_web_view_new_with_context(context));
  Gtk::Widget* wrapper = Glib::wrap(GTK_WIDGET(widget));
  WebKitSettings* settings = webkit_web_view_get_settings(widget);

  Gtk::Box layout(Gtk::ORIENTATION_VERTICAL);
  window.add(layout);

  webkit_web_view_load_uri(widget, parse_address(argv[1]).c_str());

  window.show_all();
  app->run(window);
  exit(0);
Done.
Re:C++ Lightweight, cross-platform, HTML rendering engine fo... by adamjs on Friday August 28, 2020 @12:21PM (#24306735)
FWIW Ultralight isn't tied to GTK or any windowing system (API is platform-agnostic), also the core Renderer API doesn't even require a run loop (this is vitally important if you're integrating HTML UI into complex environments like games and headless apps).