summaryrefslogtreecommitdiffstats
path: root/libmenu
diff options
context:
space:
mode:
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu.c14
-rw-r--r--libmenu/menu.h3
-rw-r--r--libmenu/menu_cmdlist.c2
-rw-r--r--libmenu/menu_filesel.c1
-rw-r--r--libmenu/menu_param.c2
-rw-r--r--libmenu/vf_menu.c16
6 files changed, 22 insertions, 16 deletions
diff --git a/libmenu/menu.c b/libmenu/menu.c
index 3c47623ed6..6d3c6fb83e 100644
--- a/libmenu/menu.c
+++ b/libmenu/menu.c
@@ -71,6 +71,7 @@ double menu_mouse_y = -1.0;
int menu_mouse_pos_updated = 0;
static struct MPContext *menu_ctx = NULL;
+static struct m_config *menu_mconfig = NULL;
static menu_def_t* menu_list = NULL;
static int menu_count = 0;
static menu_cmd_bindings_t *cmd_bindings = NULL;
@@ -85,11 +86,12 @@ menu_cmd_bindings_t *get_cmd_bindings(const char *name) {
return NULL;
}
-static int menu_parse_config(char* buffer) {
+static int menu_parse_config(char* buffer, struct m_config *mconfig)
+{
char *element,*body, **attribs, *name;
menu_info_t* minfo = NULL;
int r,i;
- ASX_Parser_t* parser = asx_parser_new();
+ ASX_Parser_t* parser = asx_parser_new(mconfig);
while(1) {
r = asx_get_element(parser,&buffer,&element,&body,&attribs);
@@ -211,7 +213,9 @@ static int menu_parse_config(char* buffer) {
#define BUF_STEP 1024
#define BUF_MIN 128
#define BUF_MAX BUF_STEP*1024
-int menu_init(struct MPContext *mpctx, char* cfg_file) {
+int menu_init(struct MPContext *mpctx, struct m_config *mconfig,
+ char* cfg_file)
+{
char* buffer = NULL;
int bl = BUF_STEP, br = 0;
int f, fd;
@@ -250,7 +254,8 @@ int menu_init(struct MPContext *mpctx, char* cfg_file) {
close(fd);
menu_ctx = mpctx;
- f = menu_parse_config(buffer);
+ menu_mconfig = mconfig;
+ f = menu_parse_config(buffer, mconfig);
free(buffer);
return f;
}
@@ -311,6 +316,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->mconfig = menu_mconfig;
m->type = &menu_list[i];
if(menu_list[i].type->open(m,menu_list[i].args))
return m;
diff --git a/libmenu/menu.h b/libmenu/menu.h
index 2d62a5be89..7b63fad547 100644
--- a/libmenu/menu.h
+++ b/libmenu/menu.h
@@ -13,6 +13,7 @@ struct m_struct_st;
struct menu_s {
struct MPContext *ctx;
+ struct m_config *mconfig;
void (*draw)(menu_t* menu,mp_image_t* mpi);
void (*read_cmd)(menu_t* menu,int cmd);
int (*read_key)(menu_t* menu,int cmd);
@@ -52,7 +53,7 @@ typedef struct menu_info_s {
#define MENU_CMD_CLICK 11
/// Global init/uninit
-int menu_init(struct MPContext *mpctx, char* cfg_file);
+int menu_init(struct MPContext *mpctx, struct m_config *mconfig, char* cfg_file);
void menu_uninit(void);
/// Open a menu defined in the config file
diff --git a/libmenu/menu_cmdlist.c b/libmenu/menu_cmdlist.c
index ab7cbeb3a9..13025c222c 100644
--- a/libmenu/menu_cmdlist.c
+++ b/libmenu/menu_cmdlist.c
@@ -98,7 +98,7 @@ static int parse_args(menu_t* menu,char* args) {
char *element,*body, **attribs, *name;
list_entry_t* m = NULL;
int r;
- ASX_Parser_t* parser = asx_parser_new();
+ ASX_Parser_t* parser = asx_parser_new(menu->mconfig);
while(1) {
r = asx_get_element(parser,&args,&element,&body,&attribs);
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index faca35cde5..faad082b64 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -31,7 +31,6 @@
int menu_keepdir = 0;
char *menu_chroot = NULL;
-extern char *filename;
struct list_entry_s {
struct list_entry p;
diff --git a/libmenu/menu_param.c b/libmenu/menu_param.c
index a1aeef44bd..6eadf8825d 100644
--- a/libmenu/menu_param.c
+++ b/libmenu/menu_param.c
@@ -94,7 +94,7 @@ static int parse_args(menu_t* menu,char* args) {
list_entry_t* m = NULL;
int r;
m_option_t* opt;
- ASX_Parser_t* parser = asx_parser_new();
+ ASX_Parser_t* parser = asx_parser_new(menu->mconfig);
while(1) {
diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c
index b2ba92ee58..2cd68f3205 100644
--- a/libmenu/vf_menu.c
+++ b/libmenu/vf_menu.c
@@ -41,15 +41,15 @@ struct vf_priv_s {
int passthrough;
};
-static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts);
+static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts);
-void vf_menu_pause_update(struct vf_instance_s* vf) {
- const vo_functions_t *video_out = mpctx_get_video_out(vf->priv->current->ctx);
+void vf_menu_pause_update(struct vf_instance* vf) {
+ const struct vo *video_out = mpctx_get_video_out(vf->priv->current->ctx);
if(pause_mpi) {
put_image(vf,pause_mpi, MP_NOPTS_VALUE);
// Don't draw the osd atm
//vf->control(vf,VFCTRL_DRAW_OSD,NULL);
- video_out->flip_page();
+ vo_flip_page(video_out);
}
}
@@ -107,7 +107,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) {
return 0;
}
-static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){
+static void get_image(struct vf_instance* vf, mp_image_t *mpi){
mp_image_t *dmpi;
if(mpi->type == MP_IMGTYPE_TEMP && (!(mpi->flags&MP_IMGFLAG_PRESERVE)) ) {
@@ -124,7 +124,7 @@ static int key_cb(int code) {
return menu_read_key(st_priv->current,code);
}
-static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
+static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
mp_image_t *dmpi = NULL;
if (vf->priv->passthrough) {
@@ -200,7 +200,7 @@ static void uninit(vf_instance_t *vf) {
}
}
-static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height,
+static int config(struct vf_instance* vf, int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt) {
#ifdef HAVE_FREETYPE
// here is the right place to get screen dimensions
@@ -214,7 +214,7 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width,
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
-static int query_format(struct vf_instance_s* vf, unsigned int fmt){
+static int query_format(struct vf_instance* vf, unsigned int fmt){
return (vf_next_query_format(vf,fmt));
}