From 7a1124897344068d727f32d70c2a05b9f52da6b4 Mon Sep 17 00:00:00 2001 From: ulion Date: Sun, 2 Dec 2007 11:14:50 +0000 Subject: [PATCH] Add type info to menu_t, now we can get the menu name and the type name of menu. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25236 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmenu/menu.c | 5 +++-- libmenu/menu.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libmenu/menu.c b/libmenu/menu.c index 3ac23ca1d8..8c9a6f7901 100644 --- a/libmenu/menu.c +++ b/libmenu/menu.c @@ -46,12 +46,12 @@ menu_info_t* menu_info_list[] = { NULL }; -typedef struct menu_def_st { +struct menu_def_st { char* name; menu_info_t* type; void* cfg; char* args; -} menu_def_t; +}; static struct MPContext *menu_ctx = NULL; static menu_def_t* menu_list = NULL; @@ -220,6 +220,7 @@ menu_t* menu_open(char *name) { m->priv_st = &(menu_list[i].type->priv_st); m->priv = m_struct_copy(m->priv_st,menu_list[i].cfg); m->ctx = menu_ctx; + m->type = &menu_list[i]; if(menu_list[i].type->open(m,menu_list[i].args)) return m; if(m->priv) diff --git a/libmenu/menu.h b/libmenu/menu.h index 7c336e4535..369ebf4808 100644 --- a/libmenu/menu.h +++ b/libmenu/menu.h @@ -2,6 +2,8 @@ struct menu_priv_s; typedef struct menu_s menu_t; +typedef struct menu_def_st menu_def_t; + struct menu_s { struct MPContext *ctx; void (*draw)(menu_t* menu,mp_image_t* mpi); @@ -13,6 +15,7 @@ struct menu_s { int show; // Draw it ? int cl; // Close request (user sent a close cmd or menu_t* parent; + menu_def_t *type; }; typedef struct menu_info_s {