diff --git a/dgl/Makefile b/dgl/Makefile index c8df8ade..caaf4d95 100644 --- a/dgl/Makefile +++ b/dgl/Makefile @@ -89,7 +89,7 @@ all: $(TARGETS) # Compat name, to be removed soon ../build/libdgl.a: ../build/libdgl-opengl.a @echo "Symlinking libdgl.a" - @ln -s $< $@ + @ln -sf $< $@ # --------------------------------------------------------------------------------------------------------------------- diff --git a/dgl/Window.hpp b/dgl/Window.hpp index 45b88b9f..3f980939 100644 --- a/dgl/Window.hpp +++ b/dgl/Window.hpp @@ -92,6 +92,8 @@ public: bool openFileBrowser(const FileBrowserOptions& options); #endif + bool isEmbed() const noexcept; + bool isVisible() const noexcept; void setVisible(bool yesNo); diff --git a/dgl/src/WidgetPrivateData.cpp b/dgl/src/WidgetPrivateData.cpp index 005e4960..2e37907f 100644 --- a/dgl/src/WidgetPrivateData.cpp +++ b/dgl/src/WidgetPrivateData.cpp @@ -16,6 +16,9 @@ #include "WidgetPrivateData.hpp" +#ifdef DGL_CAIRO +# include "../Cairo.hpp" +#endif #ifdef DGL_OPENGL # include "../OpenGL.hpp" #endif @@ -81,12 +84,16 @@ void Widget::PrivateData::display(const uint width, cairo_matrix_t matrix; cairo_get_matrix(cr, &matrix); cairo_translate(cr, absolutePos.getX(), absolutePos.getY()); - // TODO: scaling with cairo + // TODO: scaling and cropping #endif // display widget self->onDisplay(); +#ifdef DGL_CAIRO + cairo_set_matrix(cr, &matrix); +#endif + #ifdef DGL_OPENGL if (needsDisableScissor) { diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp index 1b3955c9..8fcb954c 100644 --- a/dgl/src/Window.cpp +++ b/dgl/src/Window.cpp @@ -1281,6 +1281,11 @@ bool Window::openFileBrowser(const FileBrowserOptions& options) } #endif +bool Window::isEmbed() const noexcept +{ + return pData->fUsingEmbed; +} + bool Window::isVisible() const noexcept { return pData->fVisible; diff --git a/utils/png2c.py b/utils/png2c.py index 6dc3ae62..ab023658 100755 --- a/utils/png2c.py +++ b/utils/png2c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # DISTRHO Plugin Framework (DPF) diff --git a/utils/png2rgba.py b/utils/png2rgba.py index 3575db7a..99a50899 100755 --- a/utils/png2rgba.py +++ b/utils/png2rgba.py @@ -1,8 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # DISTRHO Plugin Framework (DPF) -# Copyright (C) 2012-2016 Filipe Coelho +# Copyright (C) 2012-2019 Filipe Coelho # # 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 @@ -52,7 +52,10 @@ def png2rgba(namespace, filenames): shortFilename = filename.rsplit(os.sep, 1)[-1].split(".", 1)[0] shortFilename = shortFilename.replace("-", "_") - png = Image.open(filename) + png = Image.open(filename) + if png.getpalette(): + png = png.convert() + pngNumpy = numpy.array(png) pngData = pngNumpy.tolist() #pngData.reverse()