command: add the default-menu property

This property contains the builtin etc/menu.conf, and will be used by
select.lua. It is undocumented because it is for internal usage.
This commit is contained in:
Guido Cella authored and Kacper Michajłow committed 2026-01-25 20:56:42 +01:00
1 parent 19adc2d509
commit df7ac1d931
1 file changed
+17
+17
View File
@@ -4065,6 +4065,22 @@ static int mp_property_mdata(void *ctx, struct m_property *prop,
return M_PROPERTY_NOT_IMPLEMENTED;
}
static int mp_property_default_menu(void *ctx, struct m_property *prop,
int action, void *arg)
{
switch (action) {
case M_PROPERTY_GET:
*(char **)arg = talloc_strdup(NULL,
#include "etc/menu.conf.inc"
);
return M_PROPERTY_OK;
case M_PROPERTY_GET_TYPE:
*(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING};
return M_PROPERTY_OK;
}
return M_PROPERTY_NOT_IMPLEMENTED;
}
static int do_list_udata(int item, int action, void *arg, void *ctx);
struct udata_ctx {
@@ -4570,6 +4586,7 @@ static const struct m_property mp_properties_base[] = {
{"input-bindings", mp_property_bindings},
{"menu-data", mp_property_mdata},
{"default-menu", mp_property_default_menu},
{"user-data", mp_property_udata},
{"term-size", mp_property_term_size},