summaryrefslogtreecommitdiffstats
path: root/src/x11_in_qt4.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-11 04:48:38 +0000
committerDavid Robillard <d@drobilla.net>2012-04-11 04:48:38 +0000
commitf6263cffe3289c8d8c1566195fbf0f4d14ffdc27 (patch)
tree96c3ec5a8a28207b335d018e0468b0e8b3e7b0fc /src/x11_in_qt4.cpp
parent1b3485bcd0fa09e44aff5457db1d399b611a7151 (diff)
downloadsuil-f6263cffe3289c8d8c1566195fbf0f4d14ffdc27.tar.gz
suil-f6263cffe3289c8d8c1566195fbf0f4d14ffdc27.tar.bz2
suil-f6263cffe3289c8d8c1566195fbf0f4d14ffdc27.zip
Add suil_host_set_touch_func.
Saner feature array manipulation. Implement port index and subscribe/unsubscribe functions via new UI features. git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4160 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/x11_in_qt4.cpp')
-rw-r--r--src/x11_in_qt4.cpp35
1 files changed, 11 insertions, 24 deletions
diff --git a/src/x11_in_qt4.cpp b/src/x11_in_qt4.cpp
index ced3dcd..d5ae534 100644
--- a/src/x11_in_qt4.cpp
+++ b/src/x11_in_qt4.cpp
@@ -46,40 +46,27 @@ wrapper_resize(LV2UI_Feature_Handle handle, int width, int height)
SUIL_API
SuilWrapper*
-suil_wrapper_new(SuilHost* host,
- const char* host_type_uri,
- const char* ui_type_uri,
- const LV2_Feature* const* features)
+suil_wrapper_new(SuilHost* host,
+ const char* host_type_uri,
+ const char* ui_type_uri,
+ LV2_Feature*** features,
+ unsigned n_features)
{
SuilWrapper* wrapper = (SuilWrapper*)malloc(sizeof(SuilWrapper));
wrapper->wrap = wrapper_wrap;
wrapper->free = (SuilWrapperFreeFunc)free;
- unsigned n_features = 0;
- for (; features[n_features]; ++n_features) {}
-
QX11EmbedWidget* const ew = new QX11EmbedWidget();
- wrapper->impl = ew;
-
- wrapper->features = (LV2_Feature**)malloc(
- sizeof(LV2_Feature*) * (n_features + 3));
- memcpy(wrapper->features, features, sizeof(LV2_Feature*) * n_features);
-
- LV2_Feature* parent_feature = (LV2_Feature*)malloc(sizeof(LV2_Feature));
- parent_feature->URI = NS_UI "parent";
- parent_feature->data = (void*)(intptr_t)ew->winId();
-
- wrapper->features[n_features] = parent_feature;
- wrapper->features[n_features + 1] = NULL;
- wrapper->features[n_features + 2] = NULL;
+ wrapper->impl = ew;
wrapper->resize.handle = ew;
wrapper->resize.ui_resize = wrapper_resize;
- LV2_Feature* resize_feature = (LV2_Feature*)malloc(sizeof(LV2_Feature));
- resize_feature->URI = LV2_UI__resize;
- resize_feature->data = &wrapper->resize;
- wrapper->features[n_features + 1] = resize_feature;
+ suil_add_feature(features, n_features++, LV2_UI__parent,
+ (void*)(intptr_t)ew->winId());
+
+ suil_add_feature(features, n_features++, LV2_UI__resize,
+ &wrapper->resize);
return wrapper;
}