11/*
22 * DISTRHO Plugin Framework (DPF)
3- * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
3+ * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
44 *
55 * Permission to use, copy, modify, and/or distribute this software for any purpose with
66 * or without fee is hereby granted, provided that the above copyright notice and this
2424
2525START_NAMESPACE_DGL
2626
27+ /* define webview start */
28+ #if defined(HAVE_X11) && defined(DISTRHO_OS_LINUX) && defined(DGL_USE_WEB_VIEW)
29+ int dpf_webview_start (int argc, char * argv[]);
30+ #endif
31+
2732// --------------------------------------------------------------------------------------------------------------------
2833// build config sentinels
2934
@@ -42,6 +47,12 @@ BUILD_CONFIG_SENTINEL(fail_to_link_is_mismatch_dgl_use_file_browser_on)
4247BUILD_CONFIG_SENTINEL (fail_to_link_is_mismatch_dgl_use_file_browser_off)
4348#endif
4449
50+ #ifdef DGL_USE_WEB_VIEW
51+ BUILD_CONFIG_SENTINEL (fail_to_link_is_mismatch_dgl_use_web_view_on)
52+ #else
53+ BUILD_CONFIG_SENTINEL (fail_to_link_is_mismatch_dgl_use_web_view_off)
54+ #endif
55+
4556#ifdef DGL_NO_SHARED_RESOURCES
4657BUILD_CONFIG_SENTINEL (fail_to_link_is_mismatch_dgl_no_shared_resources_on)
4758#else
@@ -64,6 +75,11 @@ bool dpf_check_build_status() noexcept
6475 #else
6576 fail_to_link_is_mismatch_dgl_use_file_browser_off.ok &&
6677 #endif
78+ #ifdef DGL_USE_WEB_VIEW
79+ fail_to_link_is_mismatch_dgl_use_web_view_on.ok &&
80+ #else
81+ fail_to_link_is_mismatch_dgl_use_web_view_off.ok &&
82+ #endif
6783 #ifdef DGL_NO_SHARED_RESOURCES
6884 fail_to_link_is_mismatch_dgl_no_shared_resources_on.ok &&
6985 #else
@@ -96,6 +112,43 @@ Application::Application(const bool isStandalone)
96112 #else
97113 fail_to_link_is_mismatch_dgl_use_file_browser_off.ok = true ;
98114 #endif
115+ #ifdef DGL_USE_WEB_VIEW
116+ fail_to_link_is_mismatch_dgl_use_web_view_on.ok = true ;
117+ #else
118+ fail_to_link_is_mismatch_dgl_use_web_view_off.ok = true ;
119+ #endif
120+ #ifdef DGL_NO_SHARED_RESOURCES
121+ fail_to_link_is_mismatch_dgl_no_shared_resources_on.ok = true ;
122+ #else
123+ fail_to_link_is_mismatch_dgl_no_shared_resources_off.ok = true ;
124+ #endif
125+ DISTRHO_SAFE_ASSERT (dpf_check_build_status ());
126+ }
127+
128+ Application::Application (int argc, char * argv[])
129+ : pData(new PrivateData(true ))
130+ {
131+ #if defined(HAVE_X11) && defined(DISTRHO_OS_LINUX) && defined(DGL_USE_WEB_VIEW)
132+ if (argc >= 2 && std::strcmp (argv[1 ], " dpf-ld-linux-webview" ) == 0 )
133+ std::exit (dpf_webview_start (argc, argv));
134+ #endif
135+
136+ // build config sentinels
137+ #ifdef DPF_DEBUG
138+ fail_to_link_is_mismatch_dpf_debug_on.ok = true ;
139+ #else
140+ fail_to_link_is_mismatch_dpf_debug_off.ok = true ;
141+ #endif
142+ #ifdef DGL_USE_FILE_BROWSER
143+ fail_to_link_is_mismatch_dgl_use_file_browser_on.ok = true ;
144+ #else
145+ fail_to_link_is_mismatch_dgl_use_file_browser_off.ok = true ;
146+ #endif
147+ #ifdef DGL_USE_WEB_VIEW
148+ fail_to_link_is_mismatch_dgl_use_web_view_on.ok = true ;
149+ #else
150+ fail_to_link_is_mismatch_dgl_use_web_view_off.ok = true ;
151+ #endif
99152 #ifdef DGL_NO_SHARED_RESOURCES
100153 fail_to_link_is_mismatch_dgl_no_shared_resources_on.ok = true ;
101154 #else
0 commit comments