Mercurial > mplayer.hg
annotate libmenu/menu.h @ 26992:d0c873ddfaef
Only check for VIDIX PCI device name database if VIDIX is enabled.
author | diego |
---|---|
date | Sat, 07 Jun 2008 14:00:04 +0000 |
parents | 4ebf3c3f2bf6 |
children | f8b6c7045cf8 |
rev | line source |
---|---|
26029 | 1 #ifndef MPLAYER_MENU_H |
2 #define MPLAYER_MENU_H | |
8197 | 3 |
26139
4ebf3c3f2bf6
Add missing header #includes to fix 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
4 #include "m_struct.h" |
4ebf3c3f2bf6
Add missing header #includes to fix 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
5 #include "libmpcodecs/mp_image.h" |
4ebf3c3f2bf6
Add missing header #includes to fix 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
6 |
8197 | 7 struct menu_priv_s; |
8 typedef struct menu_s menu_t; | |
9 | |
25208
1b3dabc8c2b8
Add type info to menu_t, now we can get the menu name and the type name of menu.
ulion
parents:
22284
diff
changeset
|
10 typedef struct menu_def_st menu_def_t; |
1b3dabc8c2b8
Add type info to menu_t, now we can get the menu name and the type name of menu.
ulion
parents:
22284
diff
changeset
|
11 |
25417
b0cd876a0c32
Remove dependency on m_struct.h when include libmenu/menu.h.
ulion
parents:
25263
diff
changeset
|
12 struct m_struct_st; |
b0cd876a0c32
Remove dependency on m_struct.h when include libmenu/menu.h.
ulion
parents:
25263
diff
changeset
|
13 |
8197 | 14 struct menu_s { |
22284 | 15 struct MPContext *ctx; |
8197 | 16 void (*draw)(menu_t* menu,mp_image_t* mpi); |
17 void (*read_cmd)(menu_t* menu,int cmd); | |
25502
605d4e3e403f
From now on, libmenu does not steal all input keys from input modules.
ulion
parents:
25461
diff
changeset
|
18 int (*read_key)(menu_t* menu,int cmd); |
8197 | 19 void (*close)(menu_t* menu); |
25417
b0cd876a0c32
Remove dependency on m_struct.h when include libmenu/menu.h.
ulion
parents:
25263
diff
changeset
|
20 struct m_struct_st* priv_st; |
8197 | 21 struct menu_priv_s* priv; |
22 int show; // Draw it ? | |
23 int cl; // Close request (user sent a close cmd or | |
24 menu_t* parent; | |
25208
1b3dabc8c2b8
Add type info to menu_t, now we can get the menu name and the type name of menu.
ulion
parents:
22284
diff
changeset
|
25 menu_def_t *type; |
8197 | 26 }; |
27 | |
28 typedef struct menu_info_s { | |
29 const char *info; | |
30 const char *name; | |
31 const char *author; | |
32 const char *comment; | |
25419
59aba7a96701
Replace another m_struct_t by 'struct m_struct_st' to remove depedency
ulion
parents:
25417
diff
changeset
|
33 struct m_struct_st priv_st; // Config struct definition |
8197 | 34 // cfg is a config struct as defined in cfg_st, it may be used as a priv struct |
35 // cfg is filled from the attributs found in the cfg file | |
36 // the args param hold the content of the balise in the cfg file (if any) | |
37 int (*open)(menu_t* menu, char* args); | |
38 } menu_info_t; | |
39 | |
40 | |
41 #define MENU_CMD_UP 0 | |
42 #define MENU_CMD_DOWN 1 | |
43 #define MENU_CMD_OK 2 | |
44 #define MENU_CMD_CANCEL 3 | |
17945
98f4e3704a76
Allow 6 ways (up/down/left/right/ok/cancel) navigation.
albeu
parents:
8197
diff
changeset
|
45 #define MENU_CMD_LEFT 4 |
98f4e3704a76
Allow 6 ways (up/down/left/right/ok/cancel) navigation.
albeu
parents:
8197
diff
changeset
|
46 #define MENU_CMD_RIGHT 5 |
19490
f57977ac0394
support multiple actions in menu's file browser using key bindings
ben
parents:
18193
diff
changeset
|
47 #define MENU_CMD_ACTION 6 |
25263
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25208
diff
changeset
|
48 #define MENU_CMD_HOME 7 |
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25208
diff
changeset
|
49 #define MENU_CMD_END 8 |
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25208
diff
changeset
|
50 #define MENU_CMD_PAGE_UP 9 |
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25208
diff
changeset
|
51 #define MENU_CMD_PAGE_DOWN 10 |
25461 | 52 #define MENU_CMD_CLICK 11 |
8197 | 53 |
54 /// Global init/uninit | |
22284 | 55 int menu_init(struct MPContext *mpctx, char* cfg_file); |
25420 | 56 void menu_uninit(void); |
8197 | 57 |
58 /// Open a menu defined in the config file | |
59 menu_t* menu_open(char *name); | |
60 | |
61 void menu_draw(menu_t* menu,mp_image_t* mpi); | |
62 void menu_read_cmd(menu_t* menu,int cmd); | |
63 void menu_close(menu_t* menu); | |
25502
605d4e3e403f
From now on, libmenu does not steal all input keys from input modules.
ulion
parents:
25461
diff
changeset
|
64 int menu_read_key(menu_t* menu,int cmd); |
8197 | 65 |
66 //// Default implementation | |
25263
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25208
diff
changeset
|
67 int menu_dflt_read_key(menu_t* menu,int cmd); |
8197 | 68 |
25461 | 69 /// Receive mouse position events. |
70 void menu_update_mouse_pos(double x, double y); | |
71 | |
8197 | 72 /////////// Helpers |
73 | |
74 #define MENU_TEXT_TOP (1<<0) | |
75 #define MENU_TEXT_VCENTER (1<<1) | |
76 #define MENU_TEXT_BOT (1<<2) | |
77 #define MENU_TEXT_VMASK (MENU_TEXT_TOP|MENU_TEXT_VCENTER|MENU_TEXT_BOT) | |
78 #define MENU_TEXT_LEFT (1<<3) | |
79 #define MENU_TEXT_HCENTER (1<<4) | |
80 #define MENU_TEXT_RIGHT (1<<5) | |
81 #define MENU_TEXT_HMASK (MENU_TEXT_LEFT|MENU_TEXT_HCENTER|MENU_TEXT_RIGHT) | |
82 #define MENU_TEXT_CENTER (MENU_TEXT_VCENTER|MENU_TEXT_HCENTER) | |
83 | |
84 void menu_draw_text(mp_image_t* mpi, char* txt, int x, int y); | |
85 int menu_text_length(char* txt); | |
86 int menu_text_num_lines(char* txt, int max_width); | |
87 | |
88 void menu_text_size(char* txt,int max_width, | |
89 int vspace, int warp, | |
90 int* _w, int* _h); | |
91 | |
92 void menu_draw_text_full(mp_image_t* mpi,char* txt, | |
93 int x, int y,int w, int h, | |
94 int vspace, int warp, int align, int anchor); | |
17993
98eb966a4024
Add a function to draw flat boxes and use it to make the list
albeu
parents:
17945
diff
changeset
|
95 |
18193 | 96 void menu_draw_box(mp_image_t* mpi, unsigned char grey, unsigned char alpha, int x, int y, int w, int h); |
25553
6ac1ece1f9fe
Add multiple inclusion guards to all header files that lack them.
diego
parents:
25502
diff
changeset
|
97 |
26029 | 98 #endif /* MPLAYER_MENU_H */ |