libdvdcss: Sync some minor changes from upstream, up to r237
[mplayer.git] / libmenu / menu_list.h
blob8bc78e2792546752f0c5d2399f6bf8bcaeb9987b
1 /*
2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef MPLAYER_MENU_LIST_H
20 #define MPLAYER_MENU_LIST_H
22 #include "menu.h"
24 typedef struct list_entry_s list_entry_t;
27 #ifdef IMPL
28 struct list_entry_s {
29 #else
30 struct list_entry {
31 #endif
32 list_entry_t* prev;
33 list_entry_t* next;
35 char* txt;
36 char hide;
40 #ifndef IMPL
41 typedef struct menu_list_priv_s {
42 #else
43 typedef struct menu_priv_s {
44 #endif
45 list_entry_t* menu;
46 list_entry_t* current;
47 int count;
49 char* title;
50 int x,y;
51 int w,h;
52 int vspace, minb;
53 int disp_lines;
54 char* ptr;
55 int title_bg,title_bg_alpha;
56 int item_bg,item_bg_alpha;
57 int ptr_bg,ptr_bg_alpha;
58 } menu_list_priv_t;
60 typedef void (*free_entry_t)(list_entry_t* entry);
62 void menu_list_read_cmd(menu_t* menu,int cmd);
63 void menu_list_draw(menu_t* menu,mp_image_t* mpi);
64 void menu_list_add_entry(menu_t* menu,list_entry_t* entry);
65 void menu_list_init(menu_t* menu);
66 void menu_list_uninit(menu_t* menu,free_entry_t free_func);
67 int menu_list_jump_to_key(menu_t* menu,int c);
69 extern const menu_list_priv_t menu_list_priv_dflt;
71 #define MENU_LIST_PRIV_DFLT { \
72 NULL, \
73 NULL, \
74 0, \
76 "MPlayer", \
77 -1,-1, \
78 0,0, \
79 5, 3, \
80 0, \
81 NULL, \
82 0xFF, 0xFF, \
83 0xFF, 0xFF, \
84 0xA4, 0x50 \
88 #define MENU_LIST_PRIV_FIELDS \
89 { "minbor", M_ST_OFF(menu_list_priv_t,minb), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \
90 { "vspace", M_ST_OFF(menu_list_priv_t,vspace), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \
91 { "x", M_ST_OFF(menu_list_priv_t,x), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \
92 { "y", M_ST_OFF(menu_list_priv_t,y), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \
93 { "w", M_ST_OFF(menu_list_priv_t,w), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \
94 { "h", M_ST_OFF(menu_list_priv_t,h), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \
95 { "ptr", M_ST_OFF(menu_list_priv_t,ptr), CONF_TYPE_STRING, 0, 0, 0, NULL }, \
96 { "title-bg", M_ST_OFF(menu_list_priv_t,title_bg), CONF_TYPE_INT, M_OPT_RANGE, -1, 255, NULL }, \
97 { "title-bg-alpha", M_ST_OFF(menu_list_priv_t,title_bg_alpha), \
98 CONF_TYPE_INT, M_OPT_RANGE, 0, 255, NULL }, \
99 { "item-bg", M_ST_OFF(menu_list_priv_t,item_bg), CONF_TYPE_INT, M_OPT_RANGE, -1, 255, NULL }, \
100 { "item-bg-alpha", M_ST_OFF(menu_list_priv_t,item_bg_alpha), \
101 CONF_TYPE_INT, M_OPT_RANGE, 0, 255, NULL }, \
102 { "ptr-bg", M_ST_OFF(menu_list_priv_t,ptr_bg), CONF_TYPE_INT, M_OPT_RANGE, -1, 255, NULL }, \
103 { "ptr-bg-alpha", M_ST_OFF(menu_list_priv_t,ptr_bg_alpha), \
104 CONF_TYPE_INT, M_OPT_RANGE, 0, 255, NULL } \
106 #endif /* MPLAYER_MENU_LIST_H */