From 3d3ae423b30e61c624b737a306d4fa66a9af411e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 22 Feb 2011 07:57:23 +0000 Subject: Initial UI instance implementation. git-svn-id: http://svn.drobilla.net/lad/trunk/suil@3010 a436a847-0d15-0410-975c-d299462d15a1 --- src/suil_internal.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/suil_internal.h') diff --git a/src/suil_internal.h b/src/suil_internal.h index a755187..4940b69 100644 --- a/src/suil_internal.h +++ b/src/suil_internal.h @@ -21,6 +21,44 @@ #include #include +#include + #include "suil/suil.h" +#define SUIL_ERRORF(fmt, ...) fprintf(stderr, "error: %s: " fmt, \ + __func__, __VA_ARGS__) + +struct _SuilUI { + char* uri; + char* type_uri; + char* bundle_path; + char* binary_path; +}; + +typedef struct _SuilUI* SuilUI; + +struct _SuilUIs { + char* plugin_uri; + SuilUI* uis; + size_t n_uis; +}; + +struct _SuilInstance { + void* lib_handle; + const LV2UI_Descriptor* descriptor; + LV2UI_Handle handle; + LV2UI_Widget widget; +}; + +typedef void (*SuilVoidFunc)(); + +/** dlsym wrapper to return a function pointer (without annoying warning) */ +static inline SuilVoidFunc +suil_dlfunc(void* handle, const char* symbol) +{ + typedef SuilVoidFunc (*VoidFuncGetter)(void*, const char*); + VoidFuncGetter dlfunc = (VoidFuncGetter)dlsym; + return dlfunc(handle, symbol); +} + #endif // SUIL_INTERNAL_H -- cgit v1.2.1