Skip to content

Commit

Permalink
Preparations for web thingies
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed May 4, 2024
1 parent a887787 commit 21f0b14
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
19 changes: 19 additions & 0 deletions dgl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 changes: 3 additions & 0 deletions distrho/DistrhoUI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions distrho/src/DistrhoPluginChecks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
4 changes: 3 additions & 1 deletion tests/tests.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2021 Filipe Coelho <[email protected]>
* Copyright (C) 2012-2024 Filipe Coelho <[email protected]>
*
* 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
Expand All @@ -14,6 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#pragma once

#include "dgl/Application.hpp"

#include "distrho/extra/Thread.hpp"
Expand Down

0 comments on commit 21f0b14

Please sign in to comment.