From fb947e978669c3f214c072db6fcba1b75ffa69f2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 10 Feb 2022 21:59:28 +0000 Subject: [PATCH] Use X11 on HaikuOS for now, until a real backend is done --- Makefile.base.mk | 14 ++++---------- dgl/src/pugl.cpp | 15 +++++---------- distrho/extra/sofd/libsofd.c | 2 ++ 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Makefile.base.mk b/Makefile.base.mk index 762efee1..af7aaf48 100644 --- a/Makefile.base.mk +++ b/Makefile.base.mk @@ -252,15 +252,13 @@ HAVE_CAIRO = $(shell $(PKG_CONFIG) --exists cairo && echo true) ifeq ($(MACOS_OR_WINDOWS),true) HAVE_OPENGL = true else -HAVE_OPENGL = $(shell $(PKG_CONFIG) --exists gl && echo true) -ifneq ($(HAIKU),true) +HAVE_OPENGL = $(shell $(PKG_CONFIG) --exists gl && echo true) HAVE_DBUS = $(shell $(PKG_CONFIG) --exists dbus-1 && echo true) HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true) HAVE_XCURSOR = $(shell $(PKG_CONFIG) --exists xcursor && echo true) HAVE_XEXT = $(shell $(PKG_CONFIG) --exists xext && echo true) HAVE_XRANDR = $(shell $(PKG_CONFIG) --exists xrandr && echo true) endif -endif # --------------------------------------------------------------------------------------------------------------------- # Check for optional libraries @@ -304,7 +302,7 @@ DGL_SYSTEM_LIBS += -lgdi32 -lcomdlg32 # -lole32 endif -ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true) +ifneq ($(MACOS_OR_WINDOWS),true) ifeq ($(HAVE_DBUS),true) DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags dbus-1) -DHAVE_DBUS DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs dbus-1) @@ -362,7 +360,7 @@ ifeq ($(WINDOWS),true) OPENGL_LIBS = -lopengl32 endif -ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true) +ifneq ($(MACOS_OR_WINDOWS),true) OPENGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl x11) OPENGL_LIBS = $(shell $(PKG_CONFIG) --libs gl x11) endif @@ -374,7 +372,7 @@ endif # --------------------------------------------------------------------------------------------------------------------- # Set Stub specific stuff -ifeq ($(HAIKU_OR_MACOS_OR_WINDOWS),true) +ifeq ($(MACOS_OR_WINDOWS),true) HAVE_STUB = true else HAVE_STUB = $(HAVE_X11) @@ -424,12 +422,8 @@ endif ifeq ($(MACOS_OR_WINDOWS),true) HAVE_DGL = true else ifeq ($(HAVE_OPENGL),true) -ifeq ($(HAIKU),true) -HAVE_DGL = true -else HAVE_DGL = $(HAVE_X11) endif -endif # --------------------------------------------------------------------------------------------------------------------- # Optional flags diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp index f18dcb28..a570c37f 100644 --- a/dgl/src/pugl.cpp +++ b/dgl/src/pugl.cpp @@ -23,8 +23,7 @@ #include #include -#if defined(DISTRHO_OS_HAIKU) -#elif defined(DISTRHO_OS_MAC) +#if defined(DISTRHO_OS_MAC) # import # include # include @@ -106,8 +105,7 @@ START_NAMESPACE_DGL // -------------------------------------------------------------------------------------------------------------------- -#if defined(DISTRHO_OS_HAIKU) -#elif defined(DISTRHO_OS_MAC) +#if defined(DISTRHO_OS_MAC) # ifndef DISTRHO_MACOS_NAMESPACE_MACRO # define DISTRHO_MACOS_NAMESPACE_MACRO_HELPER(NS, SEP, INTERFACE) NS ## SEP ## INTERFACE # define DISTRHO_MACOS_NAMESPACE_MACRO(NS, INTERFACE) DISTRHO_MACOS_NAMESPACE_MACRO_HELPER(NS, _, INTERFACE) @@ -278,9 +276,7 @@ double puglGetDesktopScaleFactor(const PuglView* const view) void puglRaiseWindow(PuglView* const view) { -#if defined(DISTRHO_OS_HAIKU) - // nothing here yet -#elif defined(DISTRHO_OS_MAC) +#if defined(DISTRHO_OS_MAC) if (NSWindow* const window = view->impl->window ? view->impl->window : [view->impl->wrapperView window]) [window orderFrontRegardless]; @@ -325,7 +321,7 @@ PuglStatus puglSetGeometryConstraints(PuglView* const view, const uint width, co view->maxAspectY = (int)height; } -#if defined(DISTRHO_OS_HAIKU) || defined(DISTRHO_OS_MAC) +#if defined(DISTRHO_OS_MAC) puglSetMinSize(view, width, height); if (aspect) { @@ -353,8 +349,7 @@ PuglStatus puglSetWindowSize(PuglView* const view, const uint width, const uint view->frame.width = width; view->frame.height = height; -#if defined(DISTRHO_OS_HAIKU) -#elif defined(DISTRHO_OS_MAC) +#if defined(DISTRHO_OS_MAC) // replace setFrame with setFrameSize PuglInternals* const impl = view->impl; diff --git a/distrho/extra/sofd/libsofd.c b/distrho/extra/sofd/libsofd.c index 1d903840..6aaeb689 100644 --- a/distrho/extra/sofd/libsofd.c +++ b/distrho/extra/sofd/libsofd.c @@ -499,7 +499,9 @@ static int query_font_geometry (Display *dpy, GC gc, const char *txt, int *w, in if (h) *h = text_structure.ascent + text_structure.descent; if (a) *a = text_structure.ascent; if (d) *d = text_structure.descent; +#ifndef DISTRHO_OS_HAIKU // FIXME XFreeFontInfo (NULL, fontinfo, 1); +#endif return 0; }