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