common.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <vlc_picture_pool.h>
00029 #include "events.h"
00030
00031 #ifdef MODULE_NAME_IS_wingapi
00032 typedef struct GXDisplayProperties {
00033 DWORD cxWidth;
00034 DWORD cyHeight;
00035 long cbxPitch;
00036 long cbyPitch;
00037 long cBPP;
00038 DWORD ffFormat;
00039 } GXDisplayProperties;
00040
00041 typedef struct GXScreenRect {
00042 DWORD dwTop;
00043 DWORD dwLeft;
00044 DWORD dwWidth;
00045 DWORD dwHeight;
00046 } GXScreenRect;
00047
00048 # define GX_FULLSCREEN 0x01
00049 # define GX_NORMALKEYS 0x02
00050 # define GX_LANDSCAPEKEYS 0x03
00051
00052 # ifndef kfLandscape
00053 # define kfLandscape 0x8
00054 # define kfPalette 0x10
00055 # define kfDirect 0x20
00056 # define kfDirect555 0x40
00057 # define kfDirect565 0x80
00058 # define kfDirect888 0x100
00059 # define kfDirect444 0x200
00060 # define kfDirectInverted 0x400
00061 # endif
00062
00063 #endif
00064
00065
00066
00067
00068
00069
00070
00071 struct vout_display_sys_t
00072 {
00073
00074 event_thread_t *event;
00075
00076
00077 HWND hwnd;
00078 HWND hvideownd;
00079 struct vout_window_t *parent_window;
00080 HWND hparent;
00081 HWND hfswnd;
00082
00083
00084 RECT rect_display;
00085 int display_depth;
00086
00087
00088 RECT rect_parent;
00089
00090 unsigned changes;
00091
00092
00093 bool is_first_display;
00094 bool is_on_top;
00095
00096 #ifndef UNDER_CE
00097
00098
00099 UINT i_spi_lowpowertimeout;
00100 UINT i_spi_powerofftimeout;
00101 UINT i_spi_screensavetimeout;
00102
00103 #endif
00104
00105
00106 RECT rect_src;
00107 RECT rect_src_clipped;
00108 RECT rect_dest;
00109 RECT rect_dest_clipped;
00110
00111 picture_pool_t *pool;
00112
00113 #ifdef MODULE_NAME_IS_directx
00114
00115 HMONITOR hmonitor;
00116 GUID *display_driver;
00117 HMONITOR (WINAPI* MonitorFromWindow)(HWND, DWORD);
00118 BOOL (WINAPI* GetMonitorInfo)(HMONITOR, LPMONITORINFO);
00119
00120
00121 int i_align_src_boundary;
00122 int i_align_src_size;
00123 int i_align_dest_boundary;
00124 int i_align_dest_size;
00125
00126 bool use_wallpaper;
00127
00128 bool use_overlay;
00129
00130
00131 bool can_blit_fourcc;
00132
00133 uint32_t i_rgb_colorkey;
00134 uint32_t i_colorkey;
00135
00136 COLORREF color_bkg;
00137 COLORREF color_bkgtxt;
00138
00139 LPDIRECTDRAW2 ddobject;
00140 LPDIRECTDRAWSURFACE2 display;
00141 LPDIRECTDRAWCLIPPER clipper;
00142 HINSTANCE hddraw_dll;
00143
00144 picture_resource_t resource;
00145
00146
00147 vlc_mutex_t lock;
00148 bool ch_wallpaper;
00149 bool wallpaper_requested;
00150 #endif
00151
00152 #ifdef MODULE_NAME_IS_glwin32
00153 HDC hGLDC;
00154 HGLRC hGLRC;
00155 vout_opengl_t gl;
00156 vout_display_opengl_t vgl;
00157 #endif
00158
00159 #ifdef MODULE_NAME_IS_direct3d
00160 bool allow_hw_yuv;
00161
00162 bool use_desktop;
00163 struct {
00164 bool is_fullscreen;
00165 bool is_on_top;
00166 RECT win;
00167 } desktop_save;
00168 vout_display_cfg_t cfg_saved;
00169
00170
00171 HINSTANCE hd3d9_dll;
00172 LPDIRECT3D9 d3dobj;
00173 LPDIRECT3DDEVICE9 d3ddev;
00174 D3DPRESENT_PARAMETERS d3dpp;
00175
00176 LPDIRECT3DTEXTURE9 d3dtex;
00177 LPDIRECT3DVERTEXBUFFER9 d3dvtc;
00178
00179 picture_resource_t resource;
00180
00181
00182 bool reset_device;
00183 bool reopen_device;
00184
00185
00186 vlc_mutex_t lock;
00187 bool ch_desktop;
00188 bool desktop_requested;
00189 #endif
00190
00191 #if defined(MODULE_NAME_IS_wingdi) || defined(MODULE_NAME_IS_wingapi)
00192 int i_depth;
00193
00194
00195 HDC off_dc;
00196 HBITMAP off_bitmap;
00197
00198 struct
00199 {
00200 BITMAPINFO bitmapinfo;
00201 RGBQUAD red;
00202 RGBQUAD green;
00203 RGBQUAD blue;
00204 };
00205
00206 # ifdef MODULE_NAME_IS_wingapi
00207 HINSTANCE gapi_dll;
00208
00209
00210 int (*GXOpenDisplay)(HWND hWnd, DWORD dwFlags);
00211 int (*GXCloseDisplay)();
00212 void *(*GXBeginDraw)();
00213 int (*GXEndDraw)();
00214 GXDisplayProperties (*GXGetDisplayProperties)();
00215 int (*GXSuspend)();
00216 int (*GXResume)();
00217 # endif
00218 #endif
00219 };
00220
00221 #ifdef MODULE_NAME_IS_wingapi
00222 # define GXOpenDisplay vd->sys->GXOpenDisplay
00223 # define GXCloseDisplay vd->sys->GXCloseDisplay
00224 # define GXBeginDraw vd->sys->GXBeginDraw
00225 # define GXEndDraw vd->sys->GXEndDraw
00226 # define GXGetDisplayProperties vd->sys->GXGetDisplayProperties
00227 # define GXSuspend vd->sys->GXSuspend
00228 # define GXResume vd->sys->GXResume
00229 #endif
00230
00231
00232
00233
00234 int CommonInit(vout_display_t *);
00235 void CommonClean(vout_display_t *);
00236 void CommonManage(vout_display_t *);
00237 int CommonControl(vout_display_t *, int , va_list );
00238 void CommonDisplay(vout_display_t *);
00239
00240 void UpdateRects (vout_display_t *,
00241 const vout_display_cfg_t *,
00242 const video_format_t *,
00243 bool is_forced);
00244 void AlignRect(RECT *, int align_boundary, int align_size);
00245
00246
00247
00248
00249 #define IDM_TOGGLE_ON_TOP WM_USER + 1
00250 #define DX_POSITION_CHANGE 0x1000
00251 #define DX_WALLPAPER_CHANGE 0x2000
00252 #define DX_DESKTOP_CHANGE 0x4000
00253
00254
00255
00256
00257 #ifdef UNDER_CE
00258
00259 #define AdjustWindowRect(a,b,c) AdjustWindowRectEx(a,b,c,0)
00260
00261 #ifndef GCL_HBRBACKGROUND
00262 # define GCL_HBRBACKGROUND (-10)
00263 #endif
00264
00265
00266
00267 #define GetWindowPlacement(a,b)
00268 #define SetWindowPlacement(a,b)
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 #ifndef WM_NCMOUSEMOVE
00279 # define WM_NCMOUSEMOVE 160
00280 #endif
00281 #ifndef CS_OWNDC
00282 # define CS_OWNDC 32
00283 #endif
00284 #ifndef SC_SCREENSAVE
00285 # define SC_SCREENSAVE 0xF140
00286 #endif
00287 #ifndef SC_MONITORPOWER
00288 # define SC_MONITORPOWER 0xF170
00289 #endif
00290 #ifndef WM_NCPAINT
00291 # define WM_NCPAINT 133
00292 #endif
00293 #ifndef WS_OVERLAPPEDWINDOW
00294 # define WS_OVERLAPPEDWINDOW 0xcf0000
00295 #endif
00296 #ifndef WS_EX_NOPARENTNOTIFY
00297 # define WS_EX_NOPARENTNOTIFY 4
00298 #endif
00299 #ifndef WS_EX_APPWINDOW
00300 #define WS_EX_APPWINDOW 0x40000
00301 #endif
00302
00303
00304
00305
00306
00307 #endif //UNDER_CE