lv2 ui resize
This commit is contained in:
parent
c8fb9082cd
commit
e2d244f4e7
@ -125,6 +125,16 @@
|
|||||||
{{=it.tibia.lv2.ttlURI(it.lv2.ui.uri)}}
|
{{=it.tibia.lv2.ttlURI(it.lv2.ui.uri)}}
|
||||||
a ui:@UI_TYPE@ ;
|
a ui:@UI_TYPE@ ;
|
||||||
ui:binary <{{=it.product.bundleName}}@DLL_SUFFIX@> ;
|
ui:binary <{{=it.product.bundleName}}@DLL_SUFFIX@> ;
|
||||||
|
lv2:extensionData ui:resize ;
|
||||||
|
{{?!it.product.ui.userResizable}}
|
||||||
|
lv2:optionalFeature ui:noUserResize ; # doesn't work as lv2:requiredFeature, don't ask me why
|
||||||
|
{{?!it.product.ui.selfResizable}}
|
||||||
|
lv2:optionalFeature ui:fixedSize ;
|
||||||
|
{{?}}
|
||||||
|
{{?}}
|
||||||
|
{{?it.product.ui.selfResizable}}
|
||||||
|
lv2:optionalFeature ui:resize ;
|
||||||
|
{{?}}
|
||||||
lv2:requiredFeature ui:idleInterface ;
|
lv2:requiredFeature ui:idleInterface ;
|
||||||
lv2:extensionData ui:idleInterface .
|
lv2:extensionData ui:idleInterface .
|
||||||
{{?}}
|
{{?}}
|
||||||
|
@ -67,4 +67,5 @@ static uint32_t param_out_index[DATA_PRODUCT_CONTROL_OUTPUTS_N] = {
|
|||||||
|
|
||||||
{{?it.lv2.ui}}
|
{{?it.lv2.ui}}
|
||||||
#define DATA_LV2_UI_URI "{{=it.tibia.CGetUTF8StringLiteral(it.tibia.lv2.expandURI(it.lv2.ui.uri))}}"
|
#define DATA_LV2_UI_URI "{{=it.tibia.CGetUTF8StringLiteral(it.tibia.lv2.expandURI(it.lv2.ui.uri))}}"
|
||||||
|
#define DATA_UI_USER_RESIZABLE {{=it.product.ui.userResizable ? 1 : 0}}
|
||||||
{{?}}
|
{{?}}
|
||||||
|
@ -308,6 +308,8 @@ static LV2UI_Handle ui_instantiate(const LV2UI_Descriptor * descriptor, const ch
|
|||||||
if (!strcmp(features[i]->URI, LV2_UI__parent)) {
|
if (!strcmp(features[i]->URI, LV2_UI__parent)) {
|
||||||
has_parent = 1;
|
has_parent = 1;
|
||||||
parent = features[i]->data;
|
parent = features[i]->data;
|
||||||
|
} else if (!strcmp(features[i]->URI, LV2_UI__resize)) {
|
||||||
|
// TODO...
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_ui *instance = plugin_ui_create(has_parent, parent);
|
plugin_ui *instance = plugin_ui_create(has_parent, parent);
|
||||||
@ -332,10 +334,23 @@ static int ui_idle(LV2UI_Handle handle) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ui_resize(LV2UI_Feature_Handle handle, int width, int height) {
|
||||||
|
#if DATA_UI_USER_RESIZABLE
|
||||||
|
//TODO
|
||||||
|
//return plugin_ui_resize((plugin_ui *)handle, width, height);
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static const void * ui_extension_data(const char * uri) {
|
static const void * ui_extension_data(const char * uri) {
|
||||||
static const LV2UI_Idle_Interface idle = { ui_idle };
|
static const LV2UI_Idle_Interface idle = { ui_idle };
|
||||||
|
static const LV2UI_Resize resize = { NULL, ui_resize };
|
||||||
if (!strcmp(uri, LV2_UI__idleInterface))
|
if (!strcmp(uri, LV2_UI__idleInterface))
|
||||||
return &idle;
|
return &idle;
|
||||||
|
else if (!strcmp(uri, LV2_UI__resize))
|
||||||
|
return &resize;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,14 +151,13 @@ static plugin_ui *plugin_ui_create(char has_parent, void *parent) {
|
|||||||
instance->world = puglNewWorld(PUGL_MODULE, 0);
|
instance->world = puglNewWorld(PUGL_MODULE, 0);
|
||||||
instance->view = puglNewView(instance->world);
|
instance->view = puglNewView(instance->world);
|
||||||
puglSetSizeHint(instance->view, PUGL_DEFAULT_SIZE, 600, 400);
|
puglSetSizeHint(instance->view, PUGL_DEFAULT_SIZE, 600, 400);
|
||||||
puglSetViewHint(instance->view, PUGL_RESIZABLE, 0);
|
puglSetViewHint(instance->view, PUGL_RESIZABLE, PUGL_TRUE);
|
||||||
puglSetBackend(instance->view, puglCairoBackend());
|
puglSetBackend(instance->view, puglCairoBackend());
|
||||||
PuglRect frame = { 0, 0, 600, 400 };
|
PuglRect frame = { 0, 0, 600, 400 };
|
||||||
puglSetFrame(instance->view, frame);
|
puglSetFrame(instance->view, frame);
|
||||||
puglSetEventFunc(instance->view, plugin_ui_on_event);
|
puglSetEventFunc(instance->view, plugin_ui_on_event);
|
||||||
if (has_parent) {
|
if (has_parent)
|
||||||
puglSetParentWindow(instance->view, (PuglNativeView)parent);
|
puglSetParentWindow(instance->view, (PuglNativeView)parent);
|
||||||
}
|
|
||||||
if (puglRealize(instance->view)) {
|
if (puglRealize(instance->view)) {
|
||||||
puglFreeView(instance->view);
|
puglFreeView(instance->view);
|
||||||
puglFreeWorld(instance->world);
|
puglFreeWorld(instance->world);
|
||||||
|
@ -125,6 +125,10 @@
|
|||||||
"unit": "",
|
"unit": "",
|
||||||
"map": "linear"
|
"map": "linear"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"ui": {
|
||||||
|
"userResizable": true,
|
||||||
|
"selfResizable": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user