Skip to content

Commit b19316a

Browse files
committed
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.
1 parent 6218fe4 commit b19316a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

player/command.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4039,6 +4039,22 @@ static int mp_property_mdata(void *ctx, struct m_property *prop,
40394039
return M_PROPERTY_NOT_IMPLEMENTED;
40404040
}
40414041

4042+
static int mp_property_default_menu(void *ctx, struct m_property *prop,
4043+
int action, void *arg)
4044+
{
4045+
switch (action) {
4046+
case M_PROPERTY_GET:
4047+
*(char **)arg = talloc_strdup(NULL,
4048+
#include "etc/menu.conf.inc"
4049+
);
4050+
return M_PROPERTY_OK;
4051+
case M_PROPERTY_GET_TYPE:
4052+
*(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING};
4053+
return M_PROPERTY_OK;
4054+
}
4055+
return M_PROPERTY_NOT_IMPLEMENTED;
4056+
}
4057+
40424058
static int do_list_udata(int item, int action, void *arg, void *ctx);
40434059

40444060
struct udata_ctx {
@@ -4542,6 +4558,7 @@ static const struct m_property mp_properties_base[] = {
45424558
{"input-bindings", mp_property_bindings},
45434559

45444560
{"menu-data", mp_property_mdata},
4561+
{"default-menu", mp_property_default_menu},
45454562

45464563
{"user-data", mp_property_udata},
45474564
{"term-size", mp_property_term_size},

0 commit comments

Comments
 (0)