summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/GraphBox.cpp7
-rw-r--r--src/gui/MessagesWindow.cpp3
-rw-r--r--src/gui/NodeModule.cpp3
-rw-r--r--src/gui/Port.cpp3
-rw-r--r--src/gui/WindowFactory.cpp4
-rw-r--r--src/gui/ingen_gui.ui.in (renamed from src/gui/ingen_gui.ui)0
-rw-r--r--src/gui/meson.build163
-rw-r--r--src/gui/wscript127
8 files changed, 176 insertions, 134 deletions
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index f994d47c..ee3013b1 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -27,6 +27,7 @@
#include "ThreadedLoader.hpp"
#include "WidgetFactory.hpp"
#include "WindowFactory.hpp"
+#include "ingen_config.h"
#include "ganv/canvas.h"
#include "ingen/Atom.hpp"
@@ -87,8 +88,8 @@
#include <sigc++/functors/mem_fun.h>
#include <sigc++/signal.h>
-#ifdef HAVE_WEBKIT
-#include <webkit/webkit.h>
+#if USE_WEBKIT
+# include <webkit/webkit.h>
#endif
#include <cassert>
@@ -449,7 +450,7 @@ GraphBox::set_documentation(const std::string& doc, bool html)
_doc_scrolledwindow->hide();
return;
}
-#ifdef HAVE_WEBKIT
+#if USE_WEBKIT
WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
webkit_web_view_load_html_string(view, doc.c_str(), "");
Gtk::Widget* widget = Gtk::manage(Glib::wrap(GTK_WIDGET(view)));
diff --git a/src/gui/MessagesWindow.cpp b/src/gui/MessagesWindow.cpp
index 2e0fdb61..9127ad61 100644
--- a/src/gui/MessagesWindow.cpp
+++ b/src/gui/MessagesWindow.cpp
@@ -18,6 +18,7 @@
#include "App.hpp"
#include "Window.hpp"
+#include "ingen_config.h"
#include "ingen/URIs.hpp"
#include "lv2/urid/urid.h"
@@ -102,7 +103,7 @@ MessagesWindow::log(LV2_URID type, const char* fmt, va_list args)
{
std::lock_guard<std::mutex> lock(_mutex);
-#ifdef HAVE_VASPRINTF
+#if USE_VASPRINTF
char* buf = nullptr;
const int len = vasprintf(&buf, fmt, args);
#else
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index fe111572..1dbd1cd9 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -25,6 +25,7 @@
#include "SubgraphModule.hpp"
#include "WidgetFactory.hpp"
#include "WindowFactory.hpp"
+#include "ingen_config.h"
#include "ganv/Port.hpp"
#include "ingen/Atom.hpp"
@@ -531,7 +532,7 @@ NodeModule::on_selected(gboolean selected)
if (selected && win->documentation_is_visible()) {
std::string doc;
bool html = false;
-#ifdef HAVE_WEBKIT
+#if USE_WEBKIT
html = true;
#endif
if (block()->plugin_model()) {
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 65b415e3..87cb3ef1 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -24,6 +24,7 @@
#include "Style.hpp"
#include "WidgetFactory.hpp"
#include "WindowFactory.hpp"
+#include "ingen_config.h"
#include "rgba.hpp"
#include "ingen/Atom.hpp"
@@ -551,7 +552,7 @@ Port::on_selected(gboolean b)
GraphWindow* win = _app.window_factory()->parent_graph_window(block);
if (win && win->documentation_is_visible() && block->plugin_model()) {
bool html = false;
-#ifdef HAVE_WEBKIT
+#if USE_WEBKIT
html = true;
#endif
const std::string& doc = block->plugin_model()->port_documentation(
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index 153fb4f6..ae396b61 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -14,8 +14,11 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "WindowFactory.hpp"
+
#include "App.hpp"
#include "GraphBox.hpp"
+#include "GraphView.hpp"
#include "GraphWindow.hpp"
#include "LoadGraphWindow.hpp"
#include "LoadPluginWindow.hpp"
@@ -23,7 +26,6 @@
#include "PropertiesWindow.hpp"
#include "RenameWindow.hpp"
#include "WidgetFactory.hpp"
-#include "WindowFactory.hpp"
#include "ingen/Log.hpp"
#include "ingen/client/BlockModel.hpp"
diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui.in
index 9e751064..9e751064 100644
--- a/src/gui/ingen_gui.ui
+++ b/src/gui/ingen_gui.ui.in
diff --git a/src/gui/meson.build b/src/gui/meson.build
new file mode 100644
index 00000000..64192b28
--- /dev/null
+++ b/src/gui/meson.build
@@ -0,0 +1,163 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: CC0-1.0 OR GPL-3.0-or-later
+
+################
+# Dependencies #
+################
+
+gui_defines = platform_defines
+
+glibmm_dep = dependency('glibmm-2.4',
+ version: '>= 2.14.0',
+ include_type: 'system',
+ required: get_option('gui'))
+
+gthread_dep = dependency('gthread-2.0',
+ version: '>= 2.14.0',
+ include_type: 'system',
+ required: get_option('gui'))
+
+gtkmm_dep = dependency('gtkmm-2.4',
+ version: '>= 2.14.0',
+ include_type: 'system',
+ required: get_option('gui'))
+
+ganv_dep = dependency('ganv-1',
+ version: '>= 1.5.2',
+ fallback: ['ganv', 'ganv_dep'],
+ required: get_option('gui'))
+
+webkit_dep = dependency('webkit-1.0',
+ version: '>= 1.4.0',
+ include_type: 'system',
+ required: false)
+
+build_gui = (glibmm_dep.found() and
+ gthread_dep.found() and
+ gtkmm_dep.found() and
+ ganv_dep.found())
+
+if webkit_dep.found()
+ gui_defines += ['-DHAVE_WEBKIT=1']
+else
+ gui_defines += ['-DHAVE_WEBKIT=0']
+endif
+
+##########
+# Module #
+##########
+
+if build_gui
+ gui_sources = files(
+ 'App.cpp',
+ 'Arc.cpp',
+ 'BreadCrumbs.cpp',
+ 'ConnectWindow.cpp',
+ 'GraphBox.cpp',
+ 'GraphCanvas.cpp',
+ 'GraphPortModule.cpp',
+ 'GraphTreeWindow.cpp',
+ 'GraphView.cpp',
+ 'GraphWindow.cpp',
+ 'LoadGraphWindow.cpp',
+ 'LoadPluginWindow.cpp',
+ 'MessagesWindow.cpp',
+ 'NewSubgraphWindow.cpp',
+ 'NodeMenu.cpp',
+ 'NodeModule.cpp',
+ 'ObjectMenu.cpp',
+ 'PluginMenu.cpp',
+ 'Port.cpp',
+ 'PortMenu.cpp',
+ 'PropertiesWindow.cpp',
+ 'RDFS.cpp',
+ 'RenameWindow.cpp',
+ 'Style.cpp',
+ 'SubgraphModule.cpp',
+ 'ThreadedLoader.cpp',
+ 'URIEntry.cpp',
+ 'WidgetFactory.cpp',
+ 'WindowFactory.cpp',
+ 'ingen_gui.cpp',
+ )
+
+ gui_dependencies = [
+ boost_dep,
+ ganv_dep,
+ glibmm_dep,
+ gthread_dep,
+ gtkmm_dep,
+ ingen_client_dep,
+ ingen_dep,
+ lilv_dep,
+ raul_dep,
+ sigcpp_dep,
+ suil_dep,
+ thread_dep,
+ webkit_dep,
+ ]
+
+ gui_suppressions = []
+ if cpp.get_id() == 'clang'
+ gui_suppressions += [
+ '-Wno-reserved-identifier', # Ganv
+ ]
+ endif
+
+ gui_suppressions = cpp.get_supported_arguments(gui_suppressions)
+ gui_suppressions += cpp_suppressions
+
+ gui_args = gui_suppressions + gui_defines + ['-DINGEN_GUI_INTERNAL']
+
+ libingen_gui = shared_library(
+ 'ingen_gui',
+ gui_sources,
+ cpp_args: gui_args,
+ dependencies: gui_dependencies,
+ gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
+ include_directories: ingen_include_dirs,
+ install: true,
+ install_dir: ingen_module_dir,
+ )
+
+ ingen_gui_dep = declare_dependency(
+ dependencies: gui_dependencies,
+ link_with: libingen_gui,
+ )
+
+ ##########
+ # LV2 UI #
+ ##########
+
+ ingen_gui_lv2 = shared_library(
+ 'ingen_gui_lv2',
+ files('ingen_gui_lv2.cpp'),
+ cpp_args: gui_args,
+ dependencies: [ingen_gui_dep],
+ gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
+ include_directories: ingen_include_dirs,
+ install: true,
+ install_dir: lv2dir / 'ingen.lv2',
+ )
+
+ ###############
+ # Shared Data #
+ ###############
+
+ config = configuration_data()
+ config.set('INGEN_VERSION', meson.project_version())
+
+ configure_file(configuration: config,
+ input: files('ingen_gui.ui.in'),
+ output: 'ingen_gui.ui',
+ install: true,
+ install_dir: ingen_data_dir)
+
+ configure_file(copy: true,
+ input: files('ingen_style.rc'),
+ output: '@PLAINNAME@',
+ install: true,
+ install_dir: ingen_data_dir)
+endif
diff --git a/src/gui/wscript b/src/gui/wscript
deleted file mode 100644
index f2471933..00000000
--- a/src/gui/wscript
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/env python
-
-import waflib.Utils as Utils
-import waflib.Options as Options
-
-
-def options(ctx):
- opt = ctx.configuration_options()
- opt.add_option('--light-theme', action='store_true', dest='light_theme',
- help='use light coloured theme')
-
-
-def configure(conf):
- conf.check_pkg('glibmm-2.4 >= 2.14.0',
- uselib_store='GLIBMM',
- system=True,
- mandatory=False)
- conf.check_pkg('gthread-2.0 >= 2.14.0',
- uselib_store='GTHREAD',
- system=True,
- mandatory=False)
- conf.check_pkg('gtkmm-2.4 >= 2.14.0',
- uselib_store='GTKMM',
- system=True,
- mandatory=False)
- conf.check_pkg('ganv-1 >= 1.5.4',
- uselib_store='GANV',
- mandatory=False)
- if not Options.options.no_webkit:
- conf.check_pkg('webkit-1.0 >= 1.4.0',
- uselib_store='WEBKIT',
- system=True,
- mandatory=False)
-
- if conf.env.HAVE_GANV and conf.env.HAVE_GTKMM:
- conf.env.INGEN_BUILD_GUI = 1
-
- if Options.options.light_theme:
- conf.define('INGEN_USE_LIGHT_THEME', 1)
-
-
-def build(bld):
- obj = bld(features = 'cxx cxxshlib',
- cflags = ['-fvisibility=hidden'],
- export_includes = ['../../include'],
- includes = ['../../', '../../include'],
- name = 'libingen_gui',
- target = 'ingen_gui',
- install_path = '${LIBDIR}',
- use = 'libingen libingen_client',
- uselib = '''
- GANV
- GLADEMM
- GLIBMM
- GNOMECANVAS
- GTKMM
- LILV
- LV2
- RAUL
- SIGCPP
- SERD
- SORD
- SRATOM
- SOUP
- SUIL
- WEBKIT
- ''')
-
- obj.source = '''
- App.cpp
- Arc.cpp
- BreadCrumbs.cpp
- ConnectWindow.cpp
- GraphBox.cpp
- GraphCanvas.cpp
- GraphPortModule.cpp
- GraphTreeWindow.cpp
- GraphView.cpp
- GraphWindow.cpp
- LoadGraphWindow.cpp
- LoadPluginWindow.cpp
- MessagesWindow.cpp
- NewSubgraphWindow.cpp
- NodeMenu.cpp
- NodeModule.cpp
- ObjectMenu.cpp
- PluginMenu.cpp
- Port.cpp
- PortMenu.cpp
- PropertiesWindow.cpp
- RDFS.cpp
- RenameWindow.cpp
- Style.cpp
- SubgraphModule.cpp
- ThreadedLoader.cpp
- URIEntry.cpp
- WidgetFactory.cpp
- WindowFactory.cpp
- ingen_gui.cpp
- '''
-
- # XML UI definition
- bld(features = 'subst',
- source = 'ingen_gui.ui',
- target = '../../ingen_gui.ui',
- install_path = '${DATADIR}/ingen',
- chmod = Utils.O755,
- INGEN_VERSION = bld.env.INGEN_VERSION)
-
- # Gtk style
- bld(features = 'subst',
- is_copy = True,
- source = 'ingen_style.rc',
- target = '../../ingen_style.rc',
- install_path = '${DATADIR}/ingen',
- chmod = Utils.O755)
-
- # LV2 UI
- obj = bld(features = 'cxx cxxshlib',
- cflags = ['-fvisibility=hidden'],
- source = 'ingen_gui_lv2.cpp',
- includes = ['.', '../../', '../../include'],
- name = 'ingen_gui_lv2',
- target = 'ingen_gui_lv2',
- install_path = '${LV2DIR}/ingen.lv2/',
- use = 'libingen libingen_gui',
- uselib = 'LV2 SERD SORD SRATOM LILV RAUL GLIBMM GTKMM')