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
24 #include <X11/Xutil.h>
28 #if defined(CONFIG_GL) || defined(CONFIG_X11) || defined(CONFIG_XV)
29 #define X11_FULLSCREEN 1
35 #define vo_wm_FULLSCREEN 2
36 #define vo_wm_STAYS_ON_TOP 4
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
;
58 extern int mLocalDisplay
;
60 extern int vo_mouse_autohide
;
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
);
95 extern Window vo_window
;
97 extern XSizeHints vo_hint
;
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
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
);
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
* );
145 void vo_vm_switch(void);
146 void vo_vm_close(void);
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 */