Browse Source

Preparations for web thingies

Signed-off-by: falkTX <falktx@falktx.com>
pull/456/head
falkTX 1 year ago
parent
commit
21f0b148db
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 37 additions and 1 deletions
  1. +19
    -0
      dgl/Makefile
  2. +3
    -0
      distrho/DistrhoUI.hpp
  3. +12
    -0
      distrho/src/DistrhoPluginChecks.h
  4. +3
    -1
      tests/tests.hpp

+ 19
- 0
dgl/Makefile View File

@@ -112,6 +112,17 @@ endif

# ---------------------------------------------------------------------------------------------------------------------

OBJS_web = $(OBJS_common) \
$(BUILD_DIR)/dgl/Web.cpp.o

ifeq ($(MACOS),true)
OBJS_web += $(BUILD_DIR)/dgl/pugl.mm.o
else
OBJS_web += $(BUILD_DIR)/dgl/pugl.cpp.o
endif

# ---------------------------------------------------------------------------------------------------------------------

ifeq ($(HAVE_CAIRO),true)
TARGETS += $(BUILD_DIR)/libdgl-cairo.a
endif
@@ -139,6 +150,7 @@ opengl: $(BUILD_DIR)/libdgl-opengl.a
opengl3: $(BUILD_DIR)/libdgl-opengl3.a
stub: $(BUILD_DIR)/libdgl-stub.a
vulkan: $(BUILD_DIR)/libdgl-vulkan.a
web: $(BUILD_DIR)/libdgl-web.a

# ---------------------------------------------------------------------------------------------------------------------

@@ -172,6 +184,12 @@ $(BUILD_DIR)/libdgl-vulkan.a: $(OBJS_vulkan)
$(SILENT)rm -f $@
$(SILENT)$(AR) crs $@ $^

$(BUILD_DIR)/libdgl-web.a: $(OBJS_web)
-@mkdir -p $(BUILD_DIR)
@echo "Creating libdgl-web.a"
$(SILENT)rm -f $@
$(SILENT)$(AR) crs $@ $^

# Compat name, to be removed soon
$(BUILD_DIR)/libdgl.a: $(BUILD_DIR)/libdgl-opengl.a
@echo "Symlinking libdgl.a"
@@ -270,5 +288,6 @@ debug:
-include $(OBJS_opengl3:%.o=%.d)
-include $(OBJS_stub:%.o=%.d)
-include $(OBJS_vulkan:%.o=%.d)
-include $(OBJS_web:%.o=%.d)

# ---------------------------------------------------------------------------------------------------------------------

+ 3
- 0
distrho/DistrhoUI.hpp View File

@@ -44,6 +44,9 @@ typedef DGL_NAMESPACE::CairoTopLevelWidget UIWidget;
#elif DISTRHO_UI_USE_NANOVG
# include "../dgl/NanoVG.hpp"
typedef DGL_NAMESPACE::NanoTopLevelWidget UIWidget;
#elif DISTRHO_UI_USE_WEBVIEW
# include "../dgl/Web.hpp"
typedef DGL_NAMESPACE::WebViewWidget UIWidget;
#else
# include "../dgl/TopLevelWidget.hpp"
typedef DGL_NAMESPACE::TopLevelWidget UIWidget;


+ 12
- 0
distrho/src/DistrhoPluginChecks.h View File

@@ -114,6 +114,10 @@
# define DISTRHO_UI_USE_NANOVG 0
#endif

#ifndef DISTRHO_UI_USE_WEBVIEW
# define DISTRHO_UI_USE_WEBVIEW 0
#endif

// --------------------------------------------------------------------------------------------------------------------
// Define DISTRHO_PLUGIN_HAS_EMBED_UI if needed

@@ -125,6 +129,14 @@
# endif
#endif

// --------------------------------------------------------------------------------------------------------------------
// Define DISTRHO_PLUGIN_WANT_WEBVIEW if needed

#if DISTRHO_UI_USE_WEBVIEW && !DISTRHO_PLUGIN_WANT_WEBVIEW
# undef DISTRHO_PLUGIN_WANT_WEBVIEW
# define DISTRHO_PLUGIN_WANT_WEBVIEW 1
#endif

// --------------------------------------------------------------------------------------------------------------------
// Define DISTRHO_UI_URI if needed



+ 3
- 1
tests/tests.hpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -14,6 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#pragma once

#include "dgl/Application.hpp"

#include "distrho/extra/Thread.hpp"


Loading…
Cancel
Save