Add support for decoding 4:2:2 and 4:4:4 Theora files.
[mplayer.git] / libvo / x11_common.h
bloba6d6a9be8b6a1a7f46d91c39af6b9bc4663df5bb
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_X11_COMMON_H
20 #define MPLAYER_X11_COMMON_H
22 #include <stdint.h>
23 #include <X11/Xlib.h>
24 #include <X11/Xutil.h>
26 #include "config.h"
28 #if defined(CONFIG_GL) || defined(CONFIG_X11) || defined(CONFIG_XV)
29 #define X11_FULLSCREEN 1
30 #endif
32 #ifdef X11_FULLSCREEN
34 #define vo_wm_LAYER 1
35 #define vo_wm_FULLSCREEN 2
36 #define vo_wm_STAYS_ON_TOP 4
37 #define vo_wm_ABOVE 8
38 #define vo_wm_BELOW 16
39 #define vo_wm_NETWM (vo_wm_FULLSCREEN | vo_wm_STAYS_ON_TOP | vo_wm_ABOVE | vo_wm_BELOW)
41 /* EWMH state actions, see
42 http://freedesktop.org/Standards/wm-spec/index.html#id2768769 */
43 #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
44 #define _NET_WM_STATE_ADD 1 /* add/set property */
45 #define _NET_WM_STATE_TOGGLE 2 /* toggle property */
47 extern int metacity_hack;
49 extern int vo_fs_layer;
50 extern int vo_wm_type;
51 extern int vo_fs_type;
52 extern char** vo_fstype_list;
54 extern char *mDisplayName;
55 extern Display *mDisplay;
56 extern Window mRootWin;
57 extern int mScreen;
58 extern int mLocalDisplay;
60 extern int vo_mouse_autohide;
62 int vo_init( void );
63 void vo_uninit( void );
64 void vo_hidecursor ( Display* , Window );
65 void vo_showcursor( Display *disp, Window win );
66 void vo_x11_decoration( Display * vo_Display,Window w,int d );
67 void vo_x11_classhint( Display * display,Window window,const char *name );
68 void vo_x11_nofs_sizepos(int x, int y, int width, int height);
69 void vo_x11_sizehint( int x, int y, int width, int height, int max );
70 int vo_x11_check_events(Display *mydisplay);
71 void vo_x11_selectinput_witherr(Display *display, Window w, long event_mask);
72 int vo_x11_update_geometry(void);
73 void vo_x11_fullscreen( void );
74 void vo_x11_setlayer( Display * mDisplay,Window vo_window,int layer );
75 void vo_x11_uninit(void);
76 Colormap vo_x11_create_colormap(XVisualInfo *vinfo);
77 uint32_t vo_x11_set_equalizer(char *name, int value);
78 uint32_t vo_x11_get_equalizer(char *name, int *value);
79 void fstype_help(void);
80 Window vo_x11_create_smooth_window( Display *mDisplay, Window mRoot,
81 Visual *vis, int x, int y, unsigned int width, unsigned int height,
82 int depth, Colormap col_map);
83 void vo_x11_create_vo_window(XVisualInfo *vis, int x, int y,
84 unsigned int width, unsigned int height, int flags,
85 Colormap col_map, const char *classname, const char *title);
86 void vo_x11_clearwindow_part(Display *mDisplay, Window vo_window,
87 int img_width, int img_height, int use_fs);
88 void vo_x11_clearwindow( Display *mDisplay, Window vo_window );
89 void vo_x11_ontop(void);
90 void vo_x11_border(void);
91 void vo_x11_ewmh_fullscreen( int action );
93 #endif
95 extern Window vo_window;
96 extern GC vo_gc;
97 extern XSizeHints vo_hint;
99 #ifdef CONFIG_XV
100 //XvPortID xv_port;
101 extern unsigned int xv_port;
103 int vo_xv_set_eq(uint32_t xv_port, char * name, int value);
104 int vo_xv_get_eq(uint32_t xv_port, char * name, int *value);
106 int vo_xv_enable_vsync(void);
108 void vo_xv_get_max_img_dim( uint32_t * width, uint32_t * height );
110 /*** colorkey handling ***/
111 typedef struct xv_ck_info_s
113 int method; ///< CK_METHOD_* constants
114 int source; ///< CK_SRC_* constants
115 } xv_ck_info_t;
117 #define CK_METHOD_NONE 0 ///< no colorkey drawing
118 #define CK_METHOD_BACKGROUND 1 ///< set colorkey as window background
119 #define CK_METHOD_AUTOPAINT 2 ///< let xv draw the colorkey
120 #define CK_METHOD_MANUALFILL 3 ///< manually draw the colorkey
121 #define CK_SRC_USE 0 ///< use specified / default colorkey
122 #define CK_SRC_SET 1 ///< use and set specified / default colorkey
123 #define CK_SRC_CUR 2 ///< use current colorkey ( get it from xv )
125 extern xv_ck_info_t xv_ck_info;
126 extern unsigned long xv_colorkey;
128 int vo_xv_init_colorkey(void);
129 void vo_xv_draw_colorkey(int32_t x, int32_t y, int32_t w, int32_t h);
130 void xv_setup_colorkeyhandling(char const * ck_method_str, char const * ck_str);
132 /*** test functions for common suboptions ***/
133 int xv_test_ck( void * arg );
134 int xv_test_ckm( void * arg );
135 #endif
137 void vo_setwindow( Window w,GC g );
138 void vo_x11_putkey(int key);
140 void xscreensaver_heartbeat(void);
141 void saver_off( Display * );
142 void saver_on( Display * );
144 #ifdef CONFIG_XF86VM
145 void vo_vm_switch(void);
146 void vo_vm_close(void);
147 #endif
149 void update_xinerama_info(void);
151 int vo_find_depth_from_visuals(Display *dpy, int screen, Visual **visual_return);
153 #endif /* MPLAYER_X11_COMMON_H */