1 /*****************************************************************************
2 * vout.h: Windows DirectX video output header file
3 *****************************************************************************
4 * Copyright (C) 2001-2004 VideoLAN (Centrale Réseaux) and its contributors
7 * Authors: Gildas Bazin <gbazin@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
25 * event_thread_t: DirectX event thread
26 *****************************************************************************/
27 typedef struct event_thread_t
31 vout_thread_t * p_vout;
35 /*****************************************************************************
36 * vout_sys_t: video output DirectX method descriptor
37 *****************************************************************************
38 * This structure is part of the video output thread descriptor.
39 * It describes the DirectX specific properties of an output thread.
40 *****************************************************************************/
43 LPDIRECTDRAW2 p_ddobject; /* DirectDraw object */
44 LPDIRECTDRAWSURFACE2 p_display; /* Display device */
45 LPDIRECTDRAWSURFACE2 p_current_surface; /* surface currently displayed */
46 LPDIRECTDRAWCLIPPER p_clipper; /* clipper used for blitting */
47 HINSTANCE hddraw_dll; /* handle of the opened ddraw dll */
49 HWND hwnd; /* Handle of the main window */
50 HWND hvideownd; /* Handle of the video sub-window */
51 HWND hparent; /* Handle of the parent window */
52 HWND hfswnd; /* Handle of the fullscreen window */
53 WNDPROC pf_wndproc; /* Window handling callback */
55 /* Multi-monitor support */
56 HMONITOR hmonitor; /* handle of the current monitor */
57 GUID *p_display_driver;
58 HMONITOR (WINAPI* MonitorFromWindow)( HWND, DWORD );
59 BOOL (WINAPI* GetMonitorInfo)( HMONITOR, LPMONITORINFO );
61 vlc_bool_t b_using_overlay; /* Are we using an overlay surface */
62 vlc_bool_t b_use_sysmem; /* Should we use system memory for surfaces */
63 vlc_bool_t b_hw_yuv; /* Should we use hardware YUV->RGB conversions */
64 vlc_bool_t b_3buf_overlay; /* Should we use triple buffered overlays */
66 /* size of the display */
70 /* Window position and size */
77 /* Coordinates of src and dest images (used when blitting to display) */
79 RECT rect_src_clipped;
81 RECT rect_dest_clipped;
84 /* Overlay alignment restrictions */
85 int i_align_src_boundary;
87 int i_align_dest_boundary;
88 int i_align_dest_size;
90 /* DDraw capabilities */
91 int b_caps_overlay_clipping;
93 int i_rgb_colorkey; /* colorkey in RGB used by the overlay */
94 int i_colorkey; /* colorkey used by the overlay */
96 volatile uint16_t i_changes; /* changes made to the video display */
99 volatile vlc_bool_t b_cursor_hidden;
100 volatile mtime_t i_lastmoved;
103 vlc_bool_t b_on_top_change;
105 vlc_bool_t b_wallpaper;
107 COLORREF color_bkgtxt;
109 #ifdef MODULE_NAME_IS_glwin32
114 event_thread_t *p_event;
118 /*****************************************************************************
119 * picture_sys_t: direct buffer method descriptor
120 *****************************************************************************
121 * This structure is part of the picture descriptor, it describes the
122 * DirectX specific properties of a direct buffer.
123 *****************************************************************************/
126 LPDIRECTDRAWSURFACE2 p_surface;
128 LPDIRECTDRAWSURFACE2 p_front_surface;
131 /*****************************************************************************
132 * Prototypes from vout.c
133 *****************************************************************************/
134 int E_(DirectXUpdateOverlay)( vout_thread_t *p_vout );
136 /*****************************************************************************
137 * Prototypes from events.c
138 *****************************************************************************/
139 void E_(DirectXEventThread) ( event_thread_t *p_event );
140 void E_(DirectXUpdateRects) ( vout_thread_t *p_vout, vlc_bool_t b_force );
142 /*****************************************************************************
144 *****************************************************************************/
145 #define WM_VLC_HIDE_MOUSE WM_APP
146 #define WM_VLC_SHOW_MOUSE WM_APP + 1
147 #define WM_VLC_CREATE_VIDEO_WIN WM_APP + 2
148 #define WM_VLC_CHANGE_TEXT WM_APP + 3
149 #define IDM_TOGGLE_ON_TOP WM_USER + 1
150 #define DX_POSITION_CHANGE 0x1000
151 #define DX_WALLPAPER_CHANGE 0x2000
153 /*****************************************************************************
155 *****************************************************************************/
158 #define AdjustWindowRect(a,b,c)
160 #ifndef GCL_HBRBACKGROUND
161 # define GCL_HBRBACKGROUND (-10)
164 #define FindWindowEx(a,b,c,d) 0
166 #define GetWindowPlacement(a,b)
167 #define SetWindowPlacement(a,b)
168 typedef struct _WINDOWPLACEMENT {
174 RECT rcNormalPosition;
177 #ifndef WM_NCMOUSEMOVE
178 # define WM_NCMOUSEMOVE 160
183 #ifndef SC_SCREENSAVE
184 # define SC_SCREENSAVE 0xF140
186 #ifndef SC_MONITORPOWER
187 # define SC_MONITORPOWER 0xF170
190 # define WM_NCPAINT 133
192 #ifndef WS_OVERLAPPEDWINDOW
193 # define WS_OVERLAPPEDWINDOW 0xcf0000
195 #ifndef WS_EX_NOPARENTNOTIFY
196 # define WS_EX_NOPARENTNOTIFY 4
198 #ifndef WS_EX_APPWINDOW
199 #define WS_EX_APPWINDOW 0x40000
202 #define SetWindowLongPtr SetWindowLong
203 #define GetWindowLongPtr GetWindowLong
204 #define GWLP_USERDATA GWL_USERDATA