diff --git a/include/clap/all.h b/include/clap/all.h index 398a2066..a1063f96 100644 --- a/include/clap/all.h +++ b/include/clap/all.h @@ -14,6 +14,7 @@ #include "ext/draft/mini-curve-display.h" #include "ext/draft/octave-number.h" #include "ext/draft/params-origin.h" +#include "ext/draft/param-hovered.h" #include "ext/draft/project-location.h" #include "ext/draft/resource-directory.h" #include "ext/draft/scratch-memory.h" diff --git a/include/clap/ext/draft/param-hovered.h b/include/clap/ext/draft/param-hovered.h new file mode 100644 index 00000000..a863d47b --- /dev/null +++ b/include/clap/ext/draft/param-hovered.h @@ -0,0 +1,29 @@ +#pragma once + +#include "../../plugin.h" + +// This extension lets a plugin report to the host the parameter's clap_id of its last hovered UI +// control and whether it is currently hovered (usually hovered by pointer device). + +static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_HOVERED[] = "clap.param-hovered/1"; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct clap_host_param_hovered { + // Plugin informs the host about a new hover state. + // + // Should be called whenever the hovered UI control's parameter ID changes or when it changes + // from hovered to not being hovered. + // + // Only one parameter can be hovered at a time. Use CLAP_INVALID_ID as param_id if no parameter + // is hovered. + // + // [main-thread] + void(CLAP_ABI *update)(const clap_host_t *host, clap_id hovered_param_id); +} clap_host_param_hovered_t; + +#ifdef __cplusplus +} +#endif