guck

Vim-like QtWebEngine-powered browser, written in C++
git clone git://git.deurzen.net/guck
Log | Files | Refs | LICENSE

guck.cc (826B)


      1 #include "guck.hh"
      2 
      3 #include "common.hh"
      4 #include "util.hh"
      5 
      6 #include <QtWebEngine>
      7 #include <QWebEngineSettings>
      8 
      9 
     10 std::unique_ptr<guck_t>
     11 guck_t::init(int argc, char** argv)
     12 {
     13     QCoreApplication::setOrganizationName(BROWSER_NAME.c_str());
     14     QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
     15     QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
     16     QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
     17     return std::make_unique<guck_t>(argc, argv);
     18 }
     19 
     20 void
     21 guck_t::setup()
     22 {
     23     m_app->setApplicationName(BROWSER_NAME.c_str());
     24     m_app->setDesktopFileName(("org." + BROWSER_NAME + "." + BROWSER_NAME).c_str());
     25     m_app->setApplicationVersion(BROWSER_VERSION.c_str());
     26     m_app->setQuitOnLastWindowClosed(true);
     27     QtWebEngine::initialize();
     28 }
     29 
     30 void
     31 guck_t::run()
     32 {
     33     m_app->exec();
     34 }