From d1443723968f692dca46eab992bd2525a629d850 Mon Sep 17 00:00:00 2001 From: David Schornsheim <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:33:07 +0200 Subject: [PATCH 1/7] Add param-hovered as draft extension --- include/clap/all.h | 1 + include/clap/ext/draft/param-hovered.h | 48 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 include/clap/ext/draft/param-hovered.h 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..caa563df --- /dev/null +++ b/include/clap/ext/draft/param-hovered.h @@ -0,0 +1,48 @@ +#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 by a pointer device. + +static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_HOVERED[] = "clap.param-hovered/0"; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct clap_plugin_param_hovered { + // Host informs the plugin about being observed regarding param-hovered. + // + // This extension is only meaningful while the plugin's UI is open. Each time after the plugin + // opens its UI, the initial observation state is unobserved. + // + // After set_observed(..., true), the plugin must call one initial host->changed() as soon as + // possible. + // After set_observed(..., false), the plugin must stop calling host->changed(). + // + // [main-thread] + void(CLAP_ABI *set_observed)(const clap_plugin_t *plugin, bool is_observed); +} clap_plugin_param_hovered_t; + +typedef struct clap_host_param_hovered { + // Plugin informs the host about a new hover state. + // + // Should be called: + // - once after observation has been enabled + // - whenever (param_id, is_hovered) changes while observed + // + // If is_hovered is true, param_id must not be CLAP_INVALID_ID and should be set to the clap_id + // of the parameter currently hovered in the UI. + // + // If is_hovered is false, param_id is either set to the last hovered UI control's parameter id + // since the UI has been opened, or to CLAP_INVALID_ID in case no UI control has been hovered + // yet. + // + // [main-thread & plugin-observed] + void(CLAP_ABI *changed)(const clap_host_t *host, clap_id param_id, bool is_hovered); +} clap_host_param_hovered_t; + +#ifdef __cplusplus +} +#endif From de8440e5715ffc9216a4af664912ed3bc03d0afa Mon Sep 17 00:00:00 2001 From: David Schornsheim <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Fri, 19 Jun 2026 07:54:00 +0200 Subject: [PATCH 2/7] Remove plugin interface to make it simpler --- include/clap/ext/draft/param-hovered.h | 31 +++++--------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/include/clap/ext/draft/param-hovered.h b/include/clap/ext/draft/param-hovered.h index caa563df..cf5ac0e1 100644 --- a/include/clap/ext/draft/param-hovered.h +++ b/include/clap/ext/draft/param-hovered.h @@ -11,36 +11,17 @@ static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_HOVERED[] = "clap.param-hovered/ extern "C" { #endif -typedef struct clap_plugin_param_hovered { - // Host informs the plugin about being observed regarding param-hovered. - // - // This extension is only meaningful while the plugin's UI is open. Each time after the plugin - // opens its UI, the initial observation state is unobserved. - // - // After set_observed(..., true), the plugin must call one initial host->changed() as soon as - // possible. - // After set_observed(..., false), the plugin must stop calling host->changed(). - // - // [main-thread] - void(CLAP_ABI *set_observed)(const clap_plugin_t *plugin, bool is_observed); -} clap_plugin_param_hovered_t; - typedef struct clap_host_param_hovered { // Plugin informs the host about a new hover state. // - // Should be called: - // - once after observation has been enabled - // - whenever (param_id, is_hovered) changes while observed - // - // If is_hovered is true, param_id must not be CLAP_INVALID_ID and should be set to the clap_id - // of the parameter currently hovered in the UI. + // Should be called whenever the hovered UI control's parameter ID changes or when it changes + // from hovered to not being hovered. // - // If is_hovered is false, param_id is either set to the last hovered UI control's parameter id - // since the UI has been opened, or to CLAP_INVALID_ID in case no UI control has been hovered - // yet. + // Only one parameter can be hovered at a time. Use CLAP_INVALID_ID as param_id if no parameter + // is hovered. // - // [main-thread & plugin-observed] - void(CLAP_ABI *changed)(const clap_host_t *host, clap_id param_id, bool is_hovered); + // [main-thread] + void(CLAP_ABI *changed)(const clap_host_t *host, clap_id param_id); } clap_host_param_hovered_t; #ifdef __cplusplus From 62299571a3a7d0cf015c79668a69e6c27879662b Mon Sep 17 00:00:00 2001 From: David Schornsheim <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Fri, 19 Jun 2026 12:16:01 +0200 Subject: [PATCH 3/7] Extensions start at revision 1 --- include/clap/ext/draft/param-hovered.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/draft/param-hovered.h b/include/clap/ext/draft/param-hovered.h index cf5ac0e1..bb8d3143 100644 --- a/include/clap/ext/draft/param-hovered.h +++ b/include/clap/ext/draft/param-hovered.h @@ -5,7 +5,7 @@ // 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 by a pointer device. -static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_HOVERED[] = "clap.param-hovered/0"; +static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_HOVERED[] = "clap.param-hovered/1"; #ifdef __cplusplus extern "C" { From 0d41d75b6c6945db37c92e25f10a7519eb0a5482 Mon Sep 17 00:00:00 2001 From: David Schornsheim <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Fri, 19 Jun 2026 12:43:00 +0200 Subject: [PATCH 4/7] Change extension name to param-focused and changed() to update() --- include/clap/all.h | 2 +- include/clap/ext/draft/param-focused.h | 29 ++++++++++++++++++++++++++ include/clap/ext/draft/param-hovered.h | 29 -------------------------- 3 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 include/clap/ext/draft/param-focused.h delete mode 100644 include/clap/ext/draft/param-hovered.h diff --git a/include/clap/all.h b/include/clap/all.h index a1063f96..5d877725 100644 --- a/include/clap/all.h +++ b/include/clap/all.h @@ -14,7 +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/param-focused.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-focused.h b/include/clap/ext/draft/param-focused.h new file mode 100644 index 00000000..93ae605a --- /dev/null +++ b/include/clap/ext/draft/param-focused.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 focused UI +// control and whether it is currently focused (usually hovered by pointer device). + +static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_FOCUSED[] = "clap.param-hovered/1"; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct clap_host_param_focused { + // Plugin informs the host about a new focus state. + // + // Should be called whenever the focused UI control's parameter ID changes or when it changes + // from focused to not being focused. + // + // Only one parameter can be focused at a time. Use CLAP_INVALID_ID as param_id if no parameter + // is focused. + // + // [main-thread] + void(CLAP_ABI *update)(const clap_host_t *host, clap_id param_id); +} clap_host_param_focused_t; + +#ifdef __cplusplus +} +#endif diff --git a/include/clap/ext/draft/param-hovered.h b/include/clap/ext/draft/param-hovered.h deleted file mode 100644 index bb8d3143..00000000 --- a/include/clap/ext/draft/param-hovered.h +++ /dev/null @@ -1,29 +0,0 @@ -#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 by a 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 *changed)(const clap_host_t *host, clap_id param_id); -} clap_host_param_hovered_t; - -#ifdef __cplusplus -} -#endif From 6d2e9826cef23af52706f458c0bbc648ea19fcaf Mon Sep 17 00:00:00 2001 From: David Schornsheim <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Fri, 19 Jun 2026 16:42:47 +0200 Subject: [PATCH 5/7] Adapt extension string to new name --- include/clap/ext/draft/param-focused.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/draft/param-focused.h b/include/clap/ext/draft/param-focused.h index 93ae605a..0a01e62d 100644 --- a/include/clap/ext/draft/param-focused.h +++ b/include/clap/ext/draft/param-focused.h @@ -5,7 +5,7 @@ // This extension lets a plugin report to the host the parameter's clap_id of its last focused UI // control and whether it is currently focused (usually hovered by pointer device). -static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_FOCUSED[] = "clap.param-hovered/1"; +static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_FOCUSED[] = "clap.param-focused/1"; #ifdef __cplusplus extern "C" { From 905107accbc655e383d49c6600ec66c1fdb596df Mon Sep 17 00:00:00 2001 From: David Schornsheim <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Mon, 6 Jul 2026 10:33:37 +0200 Subject: [PATCH 6/7] Rename extension back to hovered --- include/clap/ext/draft/param-focused.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/clap/ext/draft/param-focused.h b/include/clap/ext/draft/param-focused.h index 0a01e62d..a863d47b 100644 --- a/include/clap/ext/draft/param-focused.h +++ b/include/clap/ext/draft/param-focused.h @@ -2,27 +2,27 @@ #include "../../plugin.h" -// This extension lets a plugin report to the host the parameter's clap_id of its last focused UI -// control and whether it is currently focused (usually hovered by pointer device). +// 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_FOCUSED[] = "clap.param-focused/1"; +static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_HOVERED[] = "clap.param-hovered/1"; #ifdef __cplusplus extern "C" { #endif -typedef struct clap_host_param_focused { - // Plugin informs the host about a new focus state. +typedef struct clap_host_param_hovered { + // Plugin informs the host about a new hover state. // - // Should be called whenever the focused UI control's parameter ID changes or when it changes - // from focused to not being focused. + // 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 focused at a time. Use CLAP_INVALID_ID as param_id if no parameter - // is focused. + // 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 param_id); -} clap_host_param_focused_t; + void(CLAP_ABI *update)(const clap_host_t *host, clap_id hovered_param_id); +} clap_host_param_hovered_t; #ifdef __cplusplus } From 3c7f8ec4dfb253d5e2db5524c43fd8e8f2b0e639 Mon Sep 17 00:00:00 2001 From: David Schornsheim <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Mon, 6 Jul 2026 10:35:06 +0200 Subject: [PATCH 7/7] Rename extension file --- include/clap/all.h | 2 +- include/clap/ext/draft/{param-focused.h => param-hovered.h} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename include/clap/ext/draft/{param-focused.h => param-hovered.h} (100%) diff --git a/include/clap/all.h b/include/clap/all.h index 5d877725..a1063f96 100644 --- a/include/clap/all.h +++ b/include/clap/all.h @@ -14,7 +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-focused.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-focused.h b/include/clap/ext/draft/param-hovered.h similarity index 100% rename from include/clap/ext/draft/param-focused.h rename to include/clap/ext/draft/param-hovered.h