aboutsummaryrefslogtreecommitdiff
path: root/sherlock_nk.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-09-01 20:10:23 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-09-01 20:10:23 +0200
commit836bd12763930887d3e367f3280699898c248ae5 (patch)
tree01f0c3adafda5e6f75e8b96253b6780161034775 /sherlock_nk.c
parenta55713ba3cca90d3ea2e474e1a7310ecece1f557 (diff)
downloadsherlock.lv2-836bd12763930887d3e367f3280699898c248ae5.tar.xz
nk: implement resize feature/extension.
Diffstat (limited to 'sherlock_nk.c')
-rw-r--r--sherlock_nk.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sherlock_nk.c b/sherlock_nk.c
index e3280df..cbd1fd3 100644
--- a/sherlock_nk.c
+++ b/sherlock_nk.c
@@ -527,11 +527,25 @@ static const LV2UI_Idle_Interface idle_ext = {
.idle = _idle
};
+static int
+_resize(LV2UI_Handle instance, int width, int height)
+{
+ plughandle_t *handle = instance;
+
+ return nk_pugl_resize(&handle->win, width, height);
+}
+
+static const LV2UI_Resize resize_ext = {
+ .ui_resize = _resize
+};
+
static const void *
extension_data(const char *uri)
{
if(!strcmp(uri, LV2_UI__idleInterface))
return &idle_ext;
+ else if(!strcmp(uri, LV2_UI__resize))
+ return &resize_ext;
return NULL;
}