aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-20 04:11:24 +0000
committerDavid Robillard <d@drobilla.net>2011-10-20 04:11:24 +0000
commitc9321a790de52835588989ac6c032a44c5eed668 (patch)
treef938a95beca8f64fb2f0c8ce5166f547337b8bbc /src/jalv.c
parentc059e981b4d563edfb19a73e48b79efab34eee86 (diff)
downloadjalv-c9321a790de52835588989ac6c032a44c5eed668.tar.gz
jalv-c9321a790de52835588989ac6c032a44c5eed668.tar.bz2
jalv-c9321a790de52835588989ac6c032a44c5eed668.zip
Support UI resize extension.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3552 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv.c')
-rw-r--r--src/jalv.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 3f25734..5f4e80a 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -34,6 +34,9 @@
#include "lv2/lv2plug.in/ns/ext/event/event-helpers.h"
#include "lv2/lv2plug.in/ns/ext/uri-map/uri-map.h"
+#ifdef HAVE_LV2_UI_RESIZE
+# include "lv2/lv2plug.in/ns/ext/ui-resize/ui-resize.h"
+#endif
#include "lilv/lilv.h"
@@ -67,9 +70,27 @@ static LV2_URI_Map_Feature uri_map = { NULL, &uri_to_id };
static const LV2_Feature uri_map_feature = { NS_EXT "uri-map", &uri_map };
static LV2_Feature instance_feature = { NS_EXT "instance-access", NULL };
+#ifdef HAVE_LV2_UI_RESIZE
+static int
+lv2_ui_resize(LV2_UI_Resize_Feature_Data data, int width, int height)
+{
+ Jalv* jalv = (Jalv*)data;
+ jalv->ui_width = width;
+ jalv->ui_height = height;
+ return jalv_ui_resize(jalv, width, height);
+}
+
+LV2_UI_Resize_Feature ui_resize = { NULL, &lv2_ui_resize };
+static const LV2_Feature ui_resize_feature = { NS_EXT "ui-resize#UIResize", &ui_resize };
+
+const LV2_Feature* features[4] = {
+ &uri_map_feature, &instance_feature, &ui_resize_feature
+};
+#else
const LV2_Feature* features[3] = {
&uri_map_feature, &instance_feature, NULL
};
+#endif
/** Abort and exit on error */
static void
@@ -431,6 +452,12 @@ main(int argc, char** argv)
"http://lv2plug.in/ns/ext/event",
"http://lv2plug.in/ns/ext/midi#MidiEvent");
+#ifdef HAVE_LV2_UI_RESIZE
+ ui_resize.data = &host;
+ host.ui_width = -1;
+ host.ui_height = -1;
+#endif
+
sem_init(&exit_sem, 0, 0);
host.done = &exit_sem;