~ubuntu-branches/ubuntu/precise/mplayer2/precise-proposed

« back to all changes in this revision

Viewing changes to libmenu/menu_list.h

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:59:30 UTC
  • mfrom: (5.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20120112225930-jsg10o7na7nk73w5
Tags: 2.0-426-gc32b3ed-2
* Upload to unstable
* don't build-depend on libcdparanoia-dev on the hurd

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of MPlayer.
3
 
 *
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.
8
 
 *
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.
13
 
 *
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.
17
 
 */
18
 
 
19
 
#ifndef MPLAYER_MENU_LIST_H
20
 
#define MPLAYER_MENU_LIST_H
21
 
 
22
 
#include "menu.h"
23
 
 
24
 
typedef struct list_entry_s list_entry_t;
25
 
 
26
 
 
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;
34
 
 
35
 
  char* txt;
36
 
  char hide;
37
 
};
38
 
 
39
 
 
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;
48
 
 
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;
59
 
 
60
 
typedef void (*free_entry_t)(list_entry_t* entry);
61
 
 
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);
68
 
 
69
 
extern const menu_list_priv_t menu_list_priv_dflt;
70
 
 
71
 
#define MENU_LIST_PRIV_DFLT { \
72
 
  NULL, \
73
 
  NULL, \
74
 
  0, \
75
 
\
76
 
  "MPlayer", \
77
 
  -1,-1, \
78
 
  0,0, \
79
 
  5, 3, \
80
 
  0, \
81
 
  NULL, \
82
 
  0xFF, 0xFF, \
83
 
  0xFF, 0xFF, \
84
 
  0xA4, 0x50 \
85
 
}
86
 
 
87
 
 
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 } \
105
 
 
106
 
#endif /* MPLAYER_MENU_LIST_H */