Browse Source

Use X11 on HaikuOS for now, until a real backend is done

pull/367/head
falkTX 3 years ago
parent
commit
fb947e9786
3 changed files with 11 additions and 20 deletions
  1. +4
    -10
      Makefile.base.mk
  2. +5
    -10
      dgl/src/pugl.cpp
  3. +2
    -0
      distrho/extra/sofd/libsofd.c

+ 4
- 10
Makefile.base.mk View File

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


+ 5
- 10
dgl/src/pugl.cpp View File

@@ -23,8 +23,7 @@
#include <cstring>
#include <ctime>

#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
#if defined(DISTRHO_OS_MAC)
# import <Cocoa/Cocoa.h>
# include <dlfcn.h>
# include <mach/mach_time.h>
@@ -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;



+ 2
- 0
distrho/extra/sofd/libsofd.c View File

@@ -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;
}



Loading…
Cancel
Save