@@ -26,11 +26,9 @@ examples: dgl | |||||
$(MAKE) all -C examples/MidiThrough | $(MAKE) all -C examples/MidiThrough | ||||
$(MAKE) all -C examples/Parameters | $(MAKE) all -C examples/Parameters | ||||
$(MAKE) all -C examples/States | $(MAKE) all -C examples/States | ||||
# ifeq ($(HAVE_CAIRO),true) | |||||
# $(MAKE) all -C examples/CairoUI | |||||
# endif | |||||
ifeq ($(HAVE_CAIRO),true) | |||||
$(MAKE) all -C examples/CairoUI | |||||
endif | |||||
ifneq ($(MACOS_OR_WINDOWS),true) | ifneq ($(MACOS_OR_WINDOWS),true) | ||||
# ExternalUI is WIP | # ExternalUI is WIP | ||||
$(MAKE) all -C examples/ExternalUI | $(MAKE) all -C examples/ExternalUI | ||||
@@ -27,6 +27,9 @@ typedef DISTRHO_NAMESPACE::ExternalWindow UIWidget; | |||||
#elif DISTRHO_UI_USE_CUSTOM | #elif DISTRHO_UI_USE_CUSTOM | ||||
# include DISTRHO_UI_CUSTOM_INCLUDE_PATH | # include DISTRHO_UI_CUSTOM_INCLUDE_PATH | ||||
typedef DISTRHO_UI_CUSTOM_WIDGET_TYPE UIWidget; | typedef DISTRHO_UI_CUSTOM_WIDGET_TYPE UIWidget; | ||||
#elif DISTRHO_UI_USE_CAIRO | |||||
# include "../dgl/Cairo.hpp" | |||||
typedef DGL_NAMESPACE::CairoTopLevelWidget UIWidget; | |||||
#elif DISTRHO_UI_USE_NANOVG | #elif DISTRHO_UI_USE_NANOVG | ||||
# include "../dgl/NanoVG.hpp" | # include "../dgl/NanoVG.hpp" | ||||
typedef DGL_NAMESPACE::NanoTopLevelWidget UIWidget; | typedef DGL_NAMESPACE::NanoTopLevelWidget UIWidget; | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -17,7 +17,6 @@ | |||||
#include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
#include "DemoWidgetBanner.hpp" | #include "DemoWidgetBanner.hpp" | ||||
#include "DemoWidgetClickable.hpp" | #include "DemoWidgetClickable.hpp" | ||||
#include "Window.hpp" | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
@@ -42,9 +41,10 @@ public: | |||||
{ | { | ||||
} | } | ||||
void onDisplay() | |||||
protected: | |||||
void onCairoDisplay(const CairoGraphicsContext& context) | |||||
{ | { | ||||
cairo_t* cr = getParentWindow().getGraphicsContext().cairo; | |||||
cairo_t* cr = context.handle; | |||||
cairo_set_source_rgb(cr, 1.0, 0.8, 0.5); | cairo_set_source_rgb(cr, 1.0, 0.8, 0.5); | ||||
cairo_paint(cr); | cairo_paint(cr); | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -16,9 +16,6 @@ | |||||
#include "DemoWidgetBanner.hpp" | #include "DemoWidgetBanner.hpp" | ||||
#include "Cairo.hpp" | |||||
#include "Window.hpp" | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
@@ -54,14 +51,15 @@ enum | |||||
columns = 72, | columns = 72, | ||||
}; | }; | ||||
DemoWidgetBanner::DemoWidgetBanner(Widget* group) | |||||
: Widget(group) | |||||
{ | |||||
} | |||||
DemoWidgetBanner::DemoWidgetBanner(SubWidget* parent) | |||||
: CairoSubWidget(parent) {} | |||||
DemoWidgetBanner::DemoWidgetBanner(TopLevelWidget* parent) | |||||
: CairoSubWidget(parent) {} | |||||
void DemoWidgetBanner::onDisplay() | |||||
void DemoWidgetBanner::onCairoDisplay(const CairoGraphicsContext& context) | |||||
{ | { | ||||
cairo_t* cr = getParentWindow().getGraphicsContext().cairo; | |||||
cairo_t* cr = context.handle; | |||||
Size<uint> sz = getSize(); | Size<uint> sz = getSize(); | ||||
int w = sz.getWidth(); | int w = sz.getWidth(); | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -14,17 +14,21 @@ | |||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
*/ | */ | ||||
#include "Widget.hpp" | |||||
#pragma once | |||||
#include "Cairo.hpp" | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
class DemoWidgetBanner : public Widget | |||||
class DemoWidgetBanner : public CairoSubWidget | |||||
{ | { | ||||
public: | public: | ||||
explicit DemoWidgetBanner(Widget* group); | |||||
void onDisplay() override; | |||||
explicit DemoWidgetBanner(SubWidget* parent); | |||||
explicit DemoWidgetBanner(TopLevelWidget* parent); | |||||
protected: | |||||
void onCairoDisplay(const CairoGraphicsContext& context) override; | |||||
}; | }; | ||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -16,21 +16,19 @@ | |||||
#include "DemoWidgetClickable.hpp" | #include "DemoWidgetClickable.hpp" | ||||
#include "Cairo.hpp" | |||||
#include "Window.hpp" | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
DemoWidgetClickable::DemoWidgetClickable(Widget* group) | |||||
: Widget(group) | |||||
{ | |||||
} | |||||
DemoWidgetClickable::DemoWidgetClickable(SubWidget* parent) | |||||
: CairoSubWidget(parent) {} | |||||
DemoWidgetClickable::DemoWidgetClickable(TopLevelWidget* parent) | |||||
: CairoSubWidget(parent) {} | |||||
void DemoWidgetClickable::onDisplay() | |||||
void DemoWidgetClickable::onCairoDisplay(const CairoGraphicsContext& context) | |||||
{ | { | ||||
cairo_t* cr = getParentWindow().getGraphicsContext().cairo; | |||||
cairo_t* cr = context.handle; | |||||
Size<uint> sz = getSize(); | Size<uint> sz = getSize(); | ||||
int w = sz.getWidth(); | int w = sz.getWidth(); | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -14,17 +14,21 @@ | |||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
*/ | */ | ||||
#include "Widget.hpp" | |||||
#pragma once | |||||
#include "Cairo.hpp" | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
class DemoWidgetClickable : public Widget | |||||
class DemoWidgetClickable : public CairoSubWidget | |||||
{ | { | ||||
public: | public: | ||||
explicit DemoWidgetClickable(Widget* group); | |||||
void onDisplay() override; | |||||
explicit DemoWidgetClickable(SubWidget* group); | |||||
explicit DemoWidgetClickable(TopLevelWidget* parent); | |||||
protected: | |||||
void onCairoDisplay(const CairoGraphicsContext& context) override; | |||||
bool onMouse(const MouseEvent& event) override; | bool onMouse(const MouseEvent& event) override; | ||||
private: | private: | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -116,3 +116,5 @@ | |||||
By default this is set to @ref DISTRHO_PLUGIN_URI with "#UI" as suffix. | By default this is set to @ref DISTRHO_PLUGIN_URI with "#UI" as suffix. | ||||
*/ | */ | ||||
#define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI" | #define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI" | ||||
#define DISTRHO_UI_USE_CAIRO 1 |
@@ -21,7 +21,6 @@ FILES_UI = \ | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Do some magic | # Do some magic | ||||
UI_TYPE = cairo | |||||
include ../../Makefile.plugins.mk | include ../../Makefile.plugins.mk | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||