if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
PLUGINS="${PLUGINS} skins"
CPPFLAGS_skins="${CPPFLAGS_skins} -O2 -U_OFF_T_ -U_off_t -fno-rtti -Imodules/gui/skins"
- LDFLAGS_skins="${LDFLAGS_skins} -loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lstdc++ -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32 -lmsimg32"
+ LDFLAGS_skins="${LDFLAGS_skins} -loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lstdc++ -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32"
else
if test "x${enable_skins}" = "xyes"; then
PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0, gthread-2.0])
* skin_common.h: Private Skin interface description
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: skin_common.h,v 1.7 2003/04/28 22:44:26 ipkiss Exp $
+ * $Id: skin_common.h,v 1.8 2003/04/29 12:54:57 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#ifdef WIN32
bool b_wx_die;
ExitTimer *p_kludgy_timer;
+
+ // We dynamically load msimg32.dll to get a pointer to TransparentBlt()
+ HINSTANCE h_msimg32_dll;
+ BOOL (WINAPI *TransparentBlt)( HDC,int,int,int,int,HDC,int,
+ int,int,int,UINT );
+ // idem for user32.dll and SetLayeredWindowAttributes()
+ HINSTANCE h_user32_dll;
+ BOOL (WINAPI *SetLayeredWindowAttributes)( HWND,COLORREF,BYTE,DWORD );
#endif
};
* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.21 2003/04/28 14:12:33 asmax Exp $
+ * $Id: skin_main.cpp,v 1.22 2003/04/29 12:54:57 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
char **pp_args = p_args;
gdk_init( &i_args, &pp_args );
+
#elif defined X11_SKINS
// Initialize X11
p_intf->p_sys->display = XOpenDisplay( NULL );
+
+#elif defined WIN32
+ // We dynamically load msimg32.dll to get a pointer to TransparentBlt()
+ p_intf->p_sys->h_msimg32_dll = LoadLibrary("msimg32.dll");
+ if( !p_intf->p_sys->h_msimg32_dll ||
+ !( p_intf->p_sys->TransparentBlt =
+ (BOOL (WINAPI*)(HDC,int,int,int,int,HDC,
+ int,int,int,int,unsigned int))
+ GetProcAddress( p_intf->p_sys->h_msimg32_dll, "TransparentBlt" ) ) )
+ {
+ p_intf->p_sys->TransparentBlt = NULL;
+ msg_Dbg( p_intf, "Couldn't find TransparentBlt(), "
+ "falling back to BitBlt()" );
+ }
+
+ // idem for user32.dll and SetLayeredWindowAttributes()
+ p_intf->p_sys->h_user32_dll = LoadLibrary("user32.dll");
+ if( !p_intf->p_sys->h_user32_dll ||
+ !( p_intf->p_sys->SetLayeredWindowAttributes =
+ (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))
+ GetProcAddress( p_intf->p_sys->h_user32_dll,
+ "SetLayeredWindowAttributes" ) ) )
+ {
+ p_intf->p_sys->SetLayeredWindowAttributes = NULL;
+ msg_Dbg( p_intf, "Couldn't find SetLayeredWindowAttributes()" );
+ }
+
#endif
// Initialize conditions and mutexes
vlc_cond_destroy( &p_intf->p_sys->init_cond );
vlc_mutex_destroy( &p_intf->p_sys->init_lock );
+#ifdef WIN32
+ // Unload msimg32.dll and user32.dll
+ if( p_intf->p_sys->h_msimg32_dll )
+ FreeLibrary( p_intf->p_sys->h_msimg32_dll );
+ if( p_intf->p_sys->h_user32_dll )
+ FreeLibrary( p_intf->p_sys->h_user32_dll );
+#endif
+
// Destroy structure
free( p_intf->p_sys );
}
* win32_bitmap.cpp: Win32 implementation of the Bitmap class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_bitmap.cpp,v 1.5 2003/04/28 00:18:27 ipkiss Exp $
+ * $Id: win32_bitmap.cpp,v 1.6 2003/04/29 12:54:57 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
DeleteObject( Brush );
delete r;
- if( IS_WINNT )
+ if( p_intf->p_sys->TransparentBlt && IS_WINNT )
{
// This function contains a memory leak on win95/win98
- TransparentBlt( bufDC, 0, 0, Width, Height, bmpDC, 0, 0,
- Width, Height, 0 );
+ p_intf->p_sys->TransparentBlt( bufDC, 0, 0, Width, Height,
+ bmpDC, 0, 0, Width, Height, 0 );
}
else
{
{
HDC destDC = ( (Win32Graphics *)dest )->GetImageHandle();
- if( IS_WINNT )
+ if( p_intf->p_sys->TransparentBlt && IS_WINNT )
{
// This function contains a memory leak on win95/win98
- TransparentBlt( destDC, xRef, yRef, w, h, bmpDC, x, y, w, h,
- AlphaColor );
+ p_intf->p_sys->TransparentBlt( destDC, xRef, yRef, w, h,
+ bmpDC, x, y, w, h, AlphaColor );
}
else
{
* win32_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_run.cpp,v 1.11 2003/04/28 22:44:26 ipkiss Exp $
+ * $Id: win32_run.cpp,v 1.12 2003/04/29 12:54:57 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
// Create a new thread for wxWindows
if( vlc_thread_create( p_intf, "Skins Dialogs Thread", SkinsDialogsThread,
- 0, 0 ) ) {
+ 0, 0 ) )
+ {
msg_Err( p_intf, "cannot create SkinsDialogsThread" );
// Don't even enter the main loop
return;
* win32_theme.cpp: Win32 implementation of the Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_theme.cpp,v 1.6 2003/04/21 21:51:16 asmax Exp $
+ * $Id: win32_theme.cpp,v 1.7 2003/04/29 12:54:57 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
}
// Create Window
- ParentWindow = CreateWindowEx( WS_EX_LAYERED|WS_EX_TOOLWINDOW,
- "ParentWindow", "VLC Media Player",
- WS_SYSMENU,
- 0, 0, 0, 0, 0, 0, hinst, NULL );
+ ParentWindow = CreateWindowEx( WS_EX_TOOLWINDOW, "ParentWindow",
+ "VLC Media Player", WS_SYSMENU, 0, 0, 0, 0, 0, 0, hinst, NULL );
+
+ // We do it this way otherwise CreateWindowEx will fail
+ // if WS_EX_LAYERED is not supported
+ SetWindowLongPtr( ParentWindow, GWL_EXSTYLE, GetWindowLong( ParentWindow,
+ GWL_EXSTYLE ) | WS_EX_LAYERED );
// Store with it a pointer to the interface thread
SetWindowLongPtr( ParentWindow, GWLP_USERDATA, (LONG_PTR)p_intf );
ShowWindow( ParentWindow, SW_SHOW );
// System tray icon
- TrayIcon.cbSize = sizeof( PNOTIFYICONDATA );\r
- TrayIcon.hWnd = ParentWindow;\r
- TrayIcon.uID = 42;\r
- TrayIcon.uFlags = NIF_ICON|NIF_TIP|NIF_MESSAGE;\r
- TrayIcon.uCallbackMessage = WM_RBUTTONDOWN;\r
+ TrayIcon.cbSize = sizeof( PNOTIFYICONDATA );
+ TrayIcon.hWnd = ParentWindow;
+ TrayIcon.uID = 42;
+ TrayIcon.uFlags = NIF_ICON|NIF_TIP|NIF_MESSAGE;
+ TrayIcon.uCallbackMessage = WM_RBUTTONDOWN;
TrayIcon.hIcon = LoadIcon( hinst, "VLC_ICON" );
strcpy( TrayIcon.szTip, "VLC Media Player" );
{
HWND hwnd;
- hwnd = CreateWindowEx( WS_EX_LAYERED|WS_EX_TOOLWINDOW,
+ hwnd = CreateWindowEx( WS_EX_TOOLWINDOW,
"SkinWindow", name.c_str(), WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT,
0, 0, ParentWindow, 0, hinst, NULL );
return;
}
+ // We do it this way otherwise CreateWindowEx will fail
+ // if WS_EX_LAYERED is not supported
+ SetWindowLongPtr( hwnd, GWL_EXSTYLE,
+ GetWindowLong( hwnd, GWL_EXSTYLE ) | WS_EX_LAYERED );
+
SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG_PTR)p_intf );
- WindowList.push_back( (SkinWindow *)new OSWindow( p_intf, hwnd, x, y, visible,
- fadetime, alpha, movealpha, dragdrop ) ) ;
+ WindowList.push_back( (SkinWindow *)new OSWindow( p_intf, hwnd, x, y,
+ visible, fadetime, alpha, movealpha, dragdrop ) ) ;
}
//---------------------------------------------------------------------------
void Win32Theme::ChangeTray()
* win32_window.cpp: Win32 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_window.cpp,v 1.10 2003/04/21 21:51:16 asmax Exp $
+ * $Id: win32_window.cpp,v 1.11 2003/04/29 12:54:57 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
//---------------------------------------------------------------------------
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
-typedef BOOL (WINAPI *SLWA)(HWND, COLORREF, BYTE, DWORD);
-HMODULE hModule = LoadLibrary( "user32.dll" );
-SLWA SetLayeredWindowAttributes =
- (SLWA)GetProcAddress( hModule, "SetLayeredWindowAttributes" );
-
//---------------------------------------------------------------------------
// Skinable Window
{
if( Value > -1 )
Alpha = Value;
- SetLayeredWindowAttributes( hWnd, 0, Alpha, LWA_ALPHA | LWA_COLORKEY );
+
+ if( p_intf->p_sys->SetLayeredWindowAttributes )
+ p_intf->p_sys->SetLayeredWindowAttributes( hWnd, 0, Alpha,
+ LWA_ALPHA | LWA_COLORKEY );
+
UpdateWindow( hWnd );
}
//---------------------------------------------------------------------------