Add explanatory comments to the #endif part of multiple inclusion guards.
[mplayer/greg.git] / libvo / sub.h
blob0ca3b5a46be8fe5636a32502a640a19a36c7233a
2 #ifndef MPLAYER_SUB_H
3 #define MPLAYER_SUB_H
5 typedef struct mp_osd_bbox_s {
6 int x1,y1,x2,y2;
7 } mp_osd_bbox_t;
9 #define OSDTYPE_OSD 1
10 #define OSDTYPE_SUBTITLE 2
11 #define OSDTYPE_PROGBAR 3
12 #define OSDTYPE_SPU 4
13 #define OSDTYPE_DVDNAV 5
14 #define OSDTYPE_TELETEXT 6
16 #define OSDFLAG_VISIBLE 1
17 #define OSDFLAG_CHANGED 2
18 #define OSDFLAG_BBOX 4
19 #define OSDFLAG_OLD_BBOX 8
20 #define OSDFLAG_FORCE_UPDATE 16
22 #define MAX_UCS 1600
23 #define MAX_UCSLINES 16
25 typedef struct mp_osd_obj_s {
26 struct mp_osd_obj_s* next;
27 unsigned char type;
28 unsigned char alignment; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
29 unsigned short flags;
30 int x,y;
31 int dxs,dys;
32 mp_osd_bbox_t bbox; // bounding box
33 mp_osd_bbox_t old_bbox; // the renderer will save bbox here
34 union {
35 struct {
36 void* sub; // value of vo_sub at last update
37 int utbl[MAX_UCS+1]; // subtitle text
38 int xtbl[MAX_UCSLINES]; // x positions
39 int lines; // no. of lines
40 } subtitle;
41 struct {
42 int elems;
43 } progbar;
44 } params;
45 int stride;
47 int allocated;
48 unsigned char *alpha_buffer;
49 unsigned char *bitmap_buffer;
50 } mp_osd_obj_t;
53 #if 0
55 // disable subtitles:
56 static inline void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
59 #else
61 #include "subreader.h"
63 extern sub_data* subdata; //currently used subtitles
64 extern subtitle* vo_sub;
66 extern unsigned char* vo_osd_text;
68 #ifdef HAVE_TV_TELETEXT
69 extern void* vo_osd_teletext_page;
70 extern int vo_osd_teletext_half;
71 extern int vo_osd_teletext_mode;
72 extern int vo_osd_teletext_format;
73 #endif
75 extern int vo_osd_progbar_type;
76 extern int vo_osd_progbar_value; // 0..255
78 extern void* vo_spudec;
79 extern void* vo_vobsub;
81 #define OSD_PLAY 0x01
82 #define OSD_PAUSE 0x02
83 #define OSD_STOP 0x03
84 #define OSD_REW 0x04
85 #define OSD_FFW 0x05
86 #define OSD_CLOCK 0x06
87 #define OSD_CONTRAST 0x07
88 #define OSD_SATURATION 0x08
89 #define OSD_VOLUME 0x09
90 #define OSD_BRIGHTNESS 0x0A
91 #define OSD_HUE 0x0B
92 #define OSD_BALANCE 0x0C
93 #define OSD_PANSCAN 0x50
95 #define OSD_PB_START 0x10
96 #define OSD_PB_0 0x11
97 #define OSD_PB_END 0x12
98 #define OSD_PB_1 0x13
100 /* now in textform */
101 extern char * sub_osd_names[];
102 extern char * sub_osd_names_short[];
104 extern int sub_unicode;
105 extern int sub_utf8;
107 #ifdef USE_ICONV
108 extern char *sub_cp;
109 #endif
110 extern int sub_pos;
111 extern int sub_width_p;
112 extern int sub_alignment;
113 extern int sub_visibility;
114 extern int sub_bg_color; /* subtitles background color */
115 extern int sub_bg_alpha;
116 extern int spu_alignment;
117 extern int spu_aamode;
118 extern float spu_gaussvar;
120 //extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
121 //extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
122 //extern void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
123 extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
124 extern void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h));
126 void vo_init_osd(void);
127 int vo_update_osd(int dxs,int dys);
128 int vo_osd_changed(int new_value);
129 int vo_osd_check_range_update(int,int,int,int);
130 void free_osd_list(void);
132 extern int vo_osd_changed_flag;
134 unsigned utf8_get_char(const char **str);
136 #ifdef USE_DVDNAV
137 #include <inttypes.h>
138 void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey);
139 #endif
141 #endif
143 #endif /* MPLAYER_SUB_H */