maocs wip
This commit is contained in:
parent
1a4d158bc0
commit
44b21010f3
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
# include "ui_apple.h"
|
||||||
#else
|
#else
|
||||||
# include <X11/Xlib.h>
|
# include <X11/Xlib.h>
|
||||||
#endif
|
#endif
|
||||||
@ -59,6 +60,7 @@ static plugin_ui *plugin_ui_create(char has_parent, void *parent, plugin_ui_call
|
|||||||
return NULL;
|
return NULL;
|
||||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
instance->widget = (void *)ui_create(has_parent, parent, WIDTH, HEIGHT);
|
||||||
#else
|
#else
|
||||||
instance->display = XOpenDisplay(NULL);
|
instance->display = XOpenDisplay(NULL);
|
||||||
if (instance->display == NULL) {
|
if (instance->display == NULL) {
|
||||||
@ -82,8 +84,12 @@ static plugin_ui *plugin_ui_create(char has_parent, void *parent, plugin_ui_call
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void plugin_ui_free(plugin_ui *instance) {
|
static void plugin_ui_free(plugin_ui *instance) {
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
#else
|
||||||
XDestroyWindow(instance->display, (Window)instance->widget);
|
XDestroyWindow(instance->display, (Window)instance->widget);
|
||||||
XCloseDisplay(instance->display);
|
XCloseDisplay(instance->display);
|
||||||
|
#endif
|
||||||
free(instance);
|
free(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@ $dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/api $dir/../
|
|||||||
|
|
||||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json $dir/../templates/vst3 $dir/../out/vst3
|
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json $dir/../templates/vst3 $dir/../out/vst3
|
||||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json $dir/../templates/vst3-make $dir/../out/vst3
|
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json $dir/../templates/vst3-make $dir/../out/vst3
|
||||||
cp $dir/plugin.h $dir/plugin_ui.h $dir/../out/vst3/src
|
cp $dir/plugin.h $dir/plugin_ui.h $dir/ui_apple.h $dir/ui_apple.m $dir/../out/vst3/src
|
||||||
cp $dir/vars-pre.mk $dir/../out/vst3
|
cp $dir/vars-pre.mk $dir/../out/vst3
|
||||||
|
|
||||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json $dir/../templates/lv2 $dir/../out/lv2
|
$dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json $dir/../templates/lv2 $dir/../out/lv2
|
||||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json $dir/../templates/lv2-make $dir/../out/lv2
|
$dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json $dir/../templates/lv2-make $dir/../out/lv2
|
||||||
cp $dir/plugin.h $dir/plugin_ui.h $dir/../out/lv2/src
|
cp $dir/plugin.h $dir/plugin_ui.h $dir/ui_apple.h $dir/ui_apple.m $dir/../out/lv2/src
|
||||||
cp $dir/vars-pre.mk $dir/../out/lv2
|
cp $dir/vars-pre.mk $dir/../out/lv2
|
||||||
|
|
||||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/web $dir/../out/web
|
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/web $dir/../out/web
|
||||||
|
21
test/ui_apple.h
Normal file
21
test/ui_apple.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Tibia
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Orastron Srl unipersonale
|
||||||
|
*
|
||||||
|
* Tibia is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3 of the License.
|
||||||
|
*
|
||||||
|
* Tibia is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Tibia. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* File author: Stefano D'Angelo
|
||||||
|
*/
|
||||||
|
|
||||||
|
void *ui_create(char has_parent, void *parent, int width, int height);
|
32
test/ui_apple.m
Normal file
32
test/ui_apple.m
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Tibia
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Orastron Srl unipersonale
|
||||||
|
*
|
||||||
|
* Tibia is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3 of the License.
|
||||||
|
*
|
||||||
|
* Tibia is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Tibia. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* File author: Stefano D'Angelo
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
void *ui_create(char has_parent, void *parent, int width, int height) {
|
||||||
|
NSView *v = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, width, height)];
|
||||||
|
/* WRONG
|
||||||
|
if (has_parent) {
|
||||||
|
NSView *p = (NSView *)parent;
|
||||||
|
[p addSubview:v positioned:NSWindowAbove relativeTo:nil];
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return (void *)v;
|
||||||
|
}
|
@ -6,14 +6,32 @@ ifeq ($(TEMPLATE), cmd)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TEMPLATE), lv2)
|
ifeq ($(TEMPLATE), lv2)
|
||||||
|
ifeq ($(OS), Windows_NT)
|
||||||
|
else
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
ifeq ($(UNAME_S), Darwin)
|
||||||
|
M_SRCS_EXTRA := $(PLUGIN_DIR)/ui_apple.m
|
||||||
|
LDFLAGS_EXTRA := -framework Cocoa -framework WebKit
|
||||||
|
else
|
||||||
CFLAGS_EXTRA := $(shell pkg-config --cflags x11)
|
CFLAGS_EXTRA := $(shell pkg-config --cflags x11)
|
||||||
LDFLAGS_EXTRA := $(shell pkg-config --libs x11) -Wl,-rpath,$(shell pkg-config --variable=libdir x11)
|
LDFLAGS_EXTRA := $(shell pkg-config --libs x11) -Wl,-rpath,$(shell pkg-config --variable=libdir x11)
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(TEMPLATE), vst3)
|
ifeq ($(TEMPLATE), vst3)
|
||||||
|
ifeq ($(OS), Windows_NT)
|
||||||
|
else
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
ifeq ($(UNAME_S), Darwin)
|
||||||
|
M_SRCS_EXTRA := $(PLUGIN_DIR)/ui_apple.m
|
||||||
|
LDFLAGS_EXTRA := -framework Cocoa -framework WebKit
|
||||||
|
else
|
||||||
CFLAGS_EXTRA := $(shell pkg-config --cflags x11)
|
CFLAGS_EXTRA := $(shell pkg-config --cflags x11)
|
||||||
LDFLAGS_EXTRA := $(shell pkg-config --libs x11) -Wl,-rpath,$(shell pkg-config --variable=libdir x11)
|
LDFLAGS_EXTRA := $(shell pkg-config --libs x11) -Wl,-rpath,$(shell pkg-config --variable=libdir x11)
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(TEMPLATE), daisy-seed)
|
ifeq ($(TEMPLATE), daisy-seed)
|
||||||
LIBDAISY_DIR := ../../../libDaisy
|
LIBDAISY_DIR := ../../../libDaisy
|
||||||
|
Loading…
Reference in New Issue
Block a user