1 /*****************************************************************************
2 * vout.h: Windows video output header file
3 *****************************************************************************
4 * Copyright (C) 2001-2004 the VideoLAN team
7 * Authors: Gildas Bazin <gbazin@videolan.org>
8 * Damien Fouilleul <damienf@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
26 * event_thread_t: event thread
27 *****************************************************************************/
28 typedef struct event_thread_t
32 vout_thread_t * p_vout;
36 #ifdef MODULE_NAME_IS_wingapi
37 typedef struct GXDisplayProperties {
44 } GXDisplayProperties;
46 typedef struct GXScreenRect {
53 # define GX_FULLSCREEN 0x01
54 # define GX_NORMALKEYS 0x02
55 # define GX_LANDSCAPEKEYS 0x03
58 # define kfLandscape 0x8
59 # define kfPalette 0x10
60 # define kfDirect 0x20
61 # define kfDirect555 0x40
62 # define kfDirect565 0x80
63 # define kfDirect888 0x100
64 # define kfDirect444 0x200
65 # define kfDirectInverted 0x400
69 /*****************************************************************************
70 * vout_sys_t: video output method descriptor
71 *****************************************************************************
72 * This structure is part of the video output thread descriptor.
73 * It describes the module specific properties of an output thread.
74 *****************************************************************************/
77 HWND hwnd; /* Handle of the main window */
78 HWND hvideownd; /* Handle of the video sub-window */
79 HWND hparent; /* Handle of the parent window */
80 HWND hfswnd; /* Handle of the fullscreen window */
81 WNDPROC pf_wndproc; /* Window handling callback */
83 /* Multi-monitor support */
84 HMONITOR hmonitor; /* handle of the current monitor */
85 GUID *p_display_driver;
86 HMONITOR (WINAPI* MonitorFromWindow)( HWND, DWORD );
87 BOOL (WINAPI* GetMonitorInfo)( HMONITOR, LPMONITORINFO );
89 /* size of the display */
93 /* size of the overall window (including black bands) */
96 /* Window position and size */
103 volatile uint16_t i_changes; /* changes made to the video display */
106 volatile bool b_cursor_hidden;
107 volatile mtime_t i_lastmoved;
108 mtime_t i_mouse_hide_timeout;
111 bool b_on_top_change;
115 /* screensaver system settings to be restored when vout is closed */
116 UINT i_spi_lowpowertimeout;
117 UINT i_spi_powerofftimeout;
118 UINT i_spi_screensavetimeout;
122 /* Coordinates of src and dest images (used when blitting to display) */
124 RECT rect_src_clipped;
126 RECT rect_dest_clipped;
128 bool b_hw_yuv; /* Should we use hardware YUV->RGB conversions */
131 #ifdef MODULE_NAME_IS_vout_directx
132 /* Overlay alignment restrictions */
133 int i_align_src_boundary;
134 int i_align_src_size;
135 int i_align_dest_boundary;
136 int i_align_dest_size;
138 bool b_wallpaper; /* show as desktop wallpaper ? */
140 bool b_using_overlay; /* Are we using an overlay surface */
141 bool b_use_sysmem; /* Should we use system memory for surfaces */
142 bool b_3buf_overlay; /* Should we use triple buffered overlays */
144 /* DDraw capabilities */
145 int b_caps_overlay_clipping;
147 int i_rgb_colorkey; /* colorkey in RGB used by the overlay */
148 int i_colorkey; /* colorkey used by the overlay */
151 COLORREF color_bkgtxt;
153 LPDIRECTDRAW2 p_ddobject; /* DirectDraw object */
154 LPDIRECTDRAWSURFACE2 p_display; /* Display device */
155 LPDIRECTDRAWSURFACE2 p_current_surface; /* surface currently displayed */
156 LPDIRECTDRAWCLIPPER p_clipper; /* clipper used for blitting */
157 HINSTANCE hddraw_dll; /* handle of the opened ddraw dll */
160 #ifdef MODULE_NAME_IS_glwin32
165 #ifdef MODULE_NAME_IS_direct3d
167 HINSTANCE hd3d9_dll; /* handle of the opened d3d9 dll */
168 LPDIRECT3D9 p_d3dobj;
169 LPDIRECT3DDEVICE9 p_d3ddev;
172 LPDIRECT3DTEXTURE9 p_d3dtex;
173 LPDIRECT3DVERTEXBUFFER9 p_d3dvtc;
176 #ifdef MODULE_NAME_IS_wingdi
180 /* Our offscreen bitmap and its framebuffer */
183 uint8_t * p_pic_buffer;
185 int i_pic_pixel_pitch;
187 BITMAPINFO bitmapinfo;
193 #ifdef MODULE_NAME_IS_wingapi
201 HINSTANCE gapi_dll; /* handle of the opened gapi dll */
204 int (*GXOpenDisplay)( HWND hWnd, DWORD dwFlags );
205 int (*GXCloseDisplay)();
206 void *(*GXBeginDraw)();
208 GXDisplayProperties (*GXGetDisplayProperties)();
214 /* suspend display */
215 bool b_suspend_display;
218 event_thread_t *p_event;
222 /*****************************************************************************
223 * Prototypes from directx.c
224 *****************************************************************************/
225 int DirectDrawUpdateOverlay( vout_thread_t *p_vout );
227 /*****************************************************************************
228 * Prototypes from events.c
229 *****************************************************************************/
230 void* EventThread ( vlc_object_t *p_this );
231 void UpdateRects ( vout_thread_t *p_vout, bool b_force );
232 void Win32ToggleFullscreen ( vout_thread_t *p_vout );
234 /*****************************************************************************
236 *****************************************************************************/
237 #define WM_VLC_HIDE_MOUSE WM_APP
238 #define WM_VLC_SHOW_MOUSE WM_APP + 1
239 #define WM_VLC_CHANGE_TEXT WM_APP + 2
240 #define IDM_TOGGLE_ON_TOP WM_USER + 1
241 #define DX_POSITION_CHANGE 0x1000
242 #define DX_WALLPAPER_CHANGE 0x2000
244 /*****************************************************************************
246 *****************************************************************************/
249 #define AdjustWindowRect(a,b,c)
251 #ifndef GCL_HBRBACKGROUND
252 # define GCL_HBRBACKGROUND (-10)
255 //#define FindWindowEx(a,b,c,d) 0
257 #define GetWindowPlacement(a,b)
258 #define SetWindowPlacement(a,b)
259 /*typedef struct _WINDOWPLACEMENT {
265 RECT rcNormalPosition;
268 #ifndef WM_NCMOUSEMOVE
269 # define WM_NCMOUSEMOVE 160
274 #ifndef SC_SCREENSAVE
275 # define SC_SCREENSAVE 0xF140
277 #ifndef SC_MONITORPOWER
278 # define SC_MONITORPOWER 0xF170
281 # define WM_NCPAINT 133
283 #ifndef WS_OVERLAPPEDWINDOW
284 # define WS_OVERLAPPEDWINDOW 0xcf0000
286 #ifndef WS_EX_NOPARENTNOTIFY
287 # define WS_EX_NOPARENTNOTIFY 4
289 #ifndef WS_EX_APPWINDOW
290 #define WS_EX_APPWINDOW 0x40000
293 //#define SetWindowLongPtr SetWindowLong
294 //#define GetWindowLongPtr GetWindowLong
295 //#define GWLP_USERDATA GWL_USERDATA