Commit 39c68369 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince: added dialogs provider + another massive cleanup + updates.

parent 23584f31
...@@ -6,6 +6,7 @@ SOURCES_wince = \ ...@@ -6,6 +6,7 @@ SOURCES_wince = \
wince.cpp \ wince.cpp \
wince.h \ wince.h \
interface.cpp \ interface.cpp \
dialogs.cpp \
menus.cpp \ menus.cpp \
open.cpp \ open.cpp \
playlist.cpp \ playlist.cpp \
......
This diff is collapsed.
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
FileInfo::FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst ) FileInfo::FileInfo( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst )
: CBaseWindow( p_intf, p_parent, h_inst )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf;
hInst = _hInst;
hwnd_fileinfo = hwndTV = NULL; hwnd_fileinfo = hwndTV = NULL;
} }
...@@ -87,7 +87,7 @@ BOOL FileInfo::CreateTreeView(HWND hwnd) ...@@ -87,7 +87,7 @@ BOOL FileInfo::CreateTreeView(HWND hwnd)
// Be sure that the tree view actually was created. // Be sure that the tree view actually was created.
if( !hwndTV ) return FALSE; if( !hwndTV ) return FALSE;
UpdateFileInfo( hwndTV ); UpdateFileInfo();
return TRUE; return TRUE;
} }
...@@ -101,7 +101,7 @@ PURPOSE: ...@@ -101,7 +101,7 @@ PURPOSE:
Update the TreeView with file information. Update the TreeView with file information.
***********************************************************************/ ***********************************************************************/
void FileInfo::UpdateFileInfo(HWND hwnd) void FileInfo::UpdateFileInfo()
{ {
TVITEM tvi = {0}; TVITEM tvi = {0};
TVINSERTSTRUCT tvins = {0}; TVINSERTSTRUCT tvins = {0};
...@@ -130,7 +130,7 @@ void FileInfo::UpdateFileInfo(HWND hwnd) ...@@ -130,7 +130,7 @@ void FileInfo::UpdateFileInfo(HWND hwnd)
tvins.hParent = TVI_ROOT; tvins.hParent = TVI_ROOT;
// Add the item to the tree-view control. // Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( hwnd, &tvins ); hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
hPrevRootItem = hPrev; hPrevRootItem = hPrev;
...@@ -150,7 +150,7 @@ void FileInfo::UpdateFileInfo(HWND hwnd) ...@@ -150,7 +150,7 @@ void FileInfo::UpdateFileInfo(HWND hwnd)
tvins.hParent = hPrevRootItem; tvins.hParent = hPrevRootItem;
// Add the item to the tree-view control. // Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( hwnd, &tvins ); hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
hPrevLev2Item = hPrev; hPrevLev2Item = hPrev;
...@@ -170,14 +170,14 @@ void FileInfo::UpdateFileInfo(HWND hwnd) ...@@ -170,14 +170,14 @@ void FileInfo::UpdateFileInfo(HWND hwnd)
tvins.hParent = hPrevLev2Item; tvins.hParent = hPrevLev2Item;
// Add the item to the tree-view control. // Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( hwnd, &tvins ); hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
} }
TreeView_Expand( hwnd, hPrevLev2Item, TVE_EXPANDPARTIAL |TVE_EXPAND ); TreeView_Expand( hwndTV, hPrevLev2Item, TVE_EXPANDPARTIAL|TVE_EXPAND );
} }
vlc_mutex_unlock( &p_input->input.p_item->lock ); vlc_mutex_unlock( &p_input->input.p_item->lock );
TreeView_Expand( hwnd, hPrevRootItem, TVE_EXPANDPARTIAL |TVE_EXPAND ); TreeView_Expand( hwndTV, hPrevRootItem, TVE_EXPANDPARTIAL|TVE_EXPAND );
return; return;
} }
...@@ -212,6 +212,11 @@ LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -212,6 +212,11 @@ LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
EndDialog( hwnd, LOWORD( wp ) ); EndDialog( hwnd, LOWORD( wp ) );
break; break;
case WM_SETFOCUS:
SHSipPreference( hwnd, SIP_DOWN );
SHFullScreen( hwnd, SHFS_HIDESIPBUTTON );
break;
case WM_COMMAND: case WM_COMMAND:
if ( LOWORD(wp) == IDOK ) if ( LOWORD(wp) == IDOK )
{ {
......
This diff is collapsed.
...@@ -46,13 +46,12 @@ ...@@ -46,13 +46,12 @@
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
ItemInfoDialog::ItemInfoDialog( intf_thread_t *_p_intf, ItemInfoDialog::ItemInfoDialog( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE _hInst, HINSTANCE h_inst,
playlist_item_t *_p_item ) playlist_item_t *_p_item )
: CBaseWindow( p_intf, p_parent, h_inst )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf;
hInst = _hInst;
p_item = _p_item; p_item = _p_item;
} }
...@@ -154,6 +153,11 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -154,6 +153,11 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
EndDialog( hwnd, LOWORD( wp ) ); EndDialog( hwnd, LOWORD( wp ) );
break; break;
case WM_SETFOCUS:
SHSipPreference( hwnd, SIP_DOWN );
SHFullScreen( hwnd, SHFS_HIDESIPBUTTON );
break;
case WM_COMMAND: case WM_COMMAND:
if( LOWORD(wp) == IDOK ) if( LOWORD(wp) == IDOK )
{ {
......
...@@ -51,23 +51,25 @@ ...@@ -51,23 +51,25 @@
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
Messages::Messages( intf_thread_t *_p_intf, HINSTANCE _hInst ) Messages::Messages( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst )
: CBaseWindow( p_intf, p_parent, h_inst )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf;
hInst = _hInst;
hListView = NULL; hListView = NULL;
b_verbose = VLC_FALSE;
hWnd = CreateWindow( _T("VLC WinCE"), _T("Messages"),
WS_POPUP|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX,
0, 0, /*CW_USEDEFAULT*/300, /*CW_USEDEFAULT*/300,
p_parent->GetHandle(), NULL, h_inst, (void *)this );
} }
/*********************************************************************** /***********************************************************************
FUNCTION: FUNCTION:
WndProc WndProc
PURPOSE: PURPOSE:
Processes messages sent to the main window. Processes messages sent to the main window.
***********************************************************************/ ***********************************************************************/
LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{ {
...@@ -80,37 +82,45 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -80,37 +82,45 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
switch( msg ) switch( msg )
{ {
case WM_INITDIALOG: case WM_CREATE:
shidi.dwMask = SHIDIM_FLAGS; shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN; SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hwnd; shidi.hDlg = hwnd;
SHInitDialog( &shidi ); SHInitDialog( &shidi );
RECT rect;
GetClientRect( hwnd, &rect );
hListView = CreateWindow( WC_LISTVIEW, NULL, hListView = CreateWindow( WC_LISTVIEW, NULL,
WS_VISIBLE | WS_CHILD | LVS_REPORT | WS_VISIBLE | WS_CHILD | LVS_REPORT |
LVS_SHOWSELALWAYS | WS_VSCROLL | WS_HSCROLL | LVS_SHOWSELALWAYS | WS_VSCROLL | WS_HSCROLL |
WS_BORDER /*| LVS_NOCOLUMNHEADER */, WS_BORDER | LVS_NOCOLUMNHEADER, 0, 0, 0, 0,
rect.left + 20, rect.top + 50,
rect.right - rect.left - ( 2 * 20 ),
rect.bottom - rect.top - 50 - 20,
hwnd, NULL, hInst, NULL ); hwnd, NULL, hInst, NULL );
ListView_SetExtendedListViewStyle( hListView, LVS_EX_FULLROWSELECT ); ListView_SetExtendedListViewStyle( hListView, LVS_EX_FULLROWSELECT );
LVCOLUMN lv; LVCOLUMN lv;
lv.mask = LVCF_WIDTH | LVCF_FMT | LVCF_TEXT; lv.mask = LVCF_FMT;
lv.fmt = LVCFMT_LEFT ; lv.fmt = LVCFMT_LEFT ;
GetClientRect( hwnd, &rect ); ListView_InsertColumn( hListView, 0, &lv );
lv.cx = rect.right - rect.left;
lv.pszText = _T("Messages");
lv.cchTextMax = 9;
ListView_InsertColumn( hListView, 0, &lv);
SetTimer( hwnd, 1, 500 /*milliseconds*/, NULL ); SetTimer( hwnd, 1, 500 /*milliseconds*/, NULL );
break;
case WM_WINDOWPOSCHANGED:
{
RECT rect;
if( !GetClientRect( hwnd, &rect ) ) break;
SetWindowPos( hListView, 0, 0, 0,
rect.right - rect.left, rect.bottom - rect.top, 0 );
LVCOLUMN lv;
lv.cx = rect.right - rect.left;
lv.mask = LVCF_WIDTH;
ListView_SetColumn( hListView, 0, &lv );
}
break;
SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON ); case WM_SETFOCUS:
SHSipPreference( hwnd, SIP_DOWN );
SHFullScreen( hwnd, SHFS_HIDESIPBUTTON );
break; break;
case WM_TIMER: case WM_TIMER:
...@@ -118,14 +128,14 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -118,14 +128,14 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
break; break;
case WM_CLOSE: case WM_CLOSE:
EndDialog( hwnd, LOWORD( wp ) ); Show( FALSE );
break; return TRUE;
case WM_COMMAND: case WM_COMMAND:
switch( LOWORD(wp) ) switch( LOWORD(wp) )
{ {
case IDOK: case IDOK:
EndDialog( hwnd, LOWORD( wp ) ); Show( FALSE );
break; break;
case IDCLEAR: case IDCLEAR:
...@@ -167,8 +177,6 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -167,8 +177,6 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
CloseHandle(fichier); CloseHandle(fichier);
} }
} }
SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON );
break; break;
default: default:
...@@ -179,7 +187,7 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -179,7 +187,7 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
break; break;
} }
return FALSE; return DefWindowProc( hwnd, msg, wp, lp );
} }
void Messages::UpdateLog() void Messages::UpdateLog()
...@@ -197,29 +205,31 @@ void Messages::UpdateLog() ...@@ -197,29 +205,31 @@ void Messages::UpdateLog()
for( i_start = p_sub->i_start; i_start != i_stop; for( i_start = p_sub->i_start; i_start != i_stop;
i_start = (i_start+1) % VLC_MSG_QSIZE ) i_start = (i_start+1) % VLC_MSG_QSIZE )
{ {
if( !b_verbose && VLC_MSG_ERR != p_sub->p_msg[i_start].i_type )
continue;
/* Append all messages to log window */
debug = p_sub->p_msg[i_start].psz_module;
switch( p_sub->p_msg[i_start].i_type ) switch( p_sub->p_msg[i_start].i_type )
{ {
case VLC_MSG_INFO:
debug += ": ";
break;
case VLC_MSG_ERR: case VLC_MSG_ERR:
debug += " error: "; case VLC_MSG_INFO:
if( p_intf->p_libvlc->i_verbose < 0 ) continue;
break; break;
case VLC_MSG_WARN: case VLC_MSG_WARN:
debug += " warning: "; if( p_intf->p_libvlc->i_verbose < 1 ) continue;
break; break;
case VLC_MSG_DBG: case VLC_MSG_DBG:
default: if( p_intf->p_libvlc->i_verbose < 2 ) continue;
debug += " debug: ";
break; break;
} }
/* Append all messages to log window */
debug = p_sub->p_msg[i_start].psz_module;
switch( p_sub->p_msg[i_start].i_type )
{
case VLC_MSG_INFO: debug += ": "; break;
case VLC_MSG_ERR: debug += " error: "; break;
case VLC_MSG_WARN: debug += " warning: "; break;
default: debug += " debug: "; break;
}
/* Add message */ /* Add message */
debug += p_sub->p_msg[i_start].psz_msg; debug += p_sub->p_msg[i_start].psz_msg;
......
...@@ -33,11 +33,10 @@ ...@@ -33,11 +33,10 @@
#include "wince.h" #include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h> #include <windowsx.h>
#include <commctrl.h> #include <commctrl.h>
#include <commdlg.h> #include <commdlg.h>
#include <shlobj.h>
/***************************************************************************** /*****************************************************************************
* Event Table. * Event Table.
...@@ -73,15 +72,13 @@ enum ...@@ -73,15 +72,13 @@ enum
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
OpenDialog::OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst, OpenDialog::OpenDialog( intf_thread_t *p_intf, CBaseWindow *p_parent,
int _i_access_method, int _i_arg, int _i_method ) HINSTANCE h_inst, int _i_access, int _i_arg )
: CBaseWindow( p_intf, p_parent, h_inst )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf; i_access = _i_access;
hInst = _hInst;
i_current_access_method = _i_access_method;
i_open_arg = _i_arg; i_open_arg = _i_arg;
i_method = _i_method;
for( int i = 0; i < 4; i++ ) for( int i = 0; i < 4; i++ )
{ {
...@@ -94,6 +91,11 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst, ...@@ -94,6 +91,11 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
net_addrs_label[i] = 0; net_addrs_label[i] = 0;
net_addrs[i] = 0; net_addrs[i] = 0;
} }
CreateWindow( _T("VLC WinCE"), _T("Messages"),
WS_POPUP|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX,
0, 0, /*CW_USEDEFAULT*/300, /*CW_USEDEFAULT*/300,
p_parent->GetHandle(), NULL, h_inst, (void *)this );
} }
/*********************************************************************** /***********************************************************************
...@@ -108,36 +110,18 @@ PURPOSE: ...@@ -108,36 +110,18 @@ PURPOSE:
LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{ {
SHINITDLGINFO shidi; SHINITDLGINFO shidi;
SHMENUBARINFO mbi;
INITCOMMONCONTROLSEX iccex; // INITCOMMONCONTROLSEX structure INITCOMMONCONTROLSEX iccex; // INITCOMMONCONTROLSEX structure
RECT rcClient; RECT rcClient;
TC_ITEM tcItem; TC_ITEM tcItem;
switch( msg ) switch( msg )
{ {
case WM_INITDIALOG: case WM_CREATE:
shidi.dwMask = SHIDIM_FLAGS; shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_FULLSCREENNOMENUBAR;
SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hwnd; shidi.hDlg = hwnd;
SHInitDialog( &shidi ); SHInitDialog( &shidi );
//Create the menubar.
memset( &mbi, 0, sizeof(SHMENUBARINFO) );
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = hwnd;
mbi.dwFlags = SHCMBF_EMPTYBAR;
mbi.hInstRes = hInst;
if( !SHCreateMenuBar( &mbi ) )
{
MessageBox( hwnd, _T("SHCreateMenuBar failed"),
_T("Error"), MB_OK );
//return -1;
}
hwndCB = mbi.hwndMB;
// Get the client area rect to put the panels in // Get the client area rect to put the panels in
GetClientRect( hwnd, &rcClient ); GetClientRect( hwnd, &rcClient );
...@@ -183,7 +167,7 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -183,7 +167,7 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
tcItem.pszText = _T("Network"); tcItem.pszText = _T("Network");
TabCtrl_InsertItem( notebook, 1, &tcItem ); TabCtrl_InsertItem( notebook, 1, &tcItem );
switch( i_current_access_method ) switch( i_access )
{ {
case FILE_ACCESS: case FILE_ACCESS:
TabCtrl_SetCurSel( notebook, 0 ); TabCtrl_SetCurSel( notebook, 0 );
...@@ -200,14 +184,19 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -200,14 +184,19 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
break; break;
case WM_CLOSE: case WM_CLOSE:
EndDialog( hwnd, LOWORD( wp ) ); Show( FALSE );
return TRUE;
case WM_SETFOCUS:
SHFullScreen( hwnd, SHFS_SHOWSIPBUTTON );
SHSipPreference( hwnd, SIP_DOWN );
break; break;
case WM_COMMAND: case WM_COMMAND:
if( LOWORD(wp) == IDOK ) if( LOWORD(wp) == IDOK )
{ {
OnOk(); OnOk();
EndDialog( hwnd, LOWORD( wp ) ); Show( FALSE );
break; break;
} }
if( HIWORD(wp) == BN_CLICKED ) if( HIWORD(wp) == BN_CLICKED )
...@@ -232,7 +221,6 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -232,7 +221,6 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
OnSubsFileSettings( hwnd ); OnSubsFileSettings( hwnd );
} else if( (HWND)lp == browse_button ) } else if( (HWND)lp == browse_button )
{ {
SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON );
OnFileBrowse(); OnFileBrowse();
} }
break; break;
...@@ -273,7 +261,7 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -273,7 +261,7 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
break; break;
} }
return FALSE; return DefWindowProc( hwnd, msg, wp, lp );
} }
/***************************************************************************** /*****************************************************************************
...@@ -281,8 +269,8 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -281,8 +269,8 @@ LRESULT OpenDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
*****************************************************************************/ *****************************************************************************/
void OpenDialog::FilePanel( HWND hwnd ) void OpenDialog::FilePanel( HWND hwnd )
{ {
RECT rc; RECT rc;
GetWindowRect( notebook, &rc); GetWindowRect( notebook, &rc );
/* Create browse file line */ /* Create browse file line */
file_combo = CreateWindow( _T("COMBOBOX"), _T(""), file_combo = CreateWindow( _T("COMBOBOX"), _T(""),
...@@ -325,7 +313,7 @@ void OpenDialog::FilePanel( HWND hwnd ) ...@@ -325,7 +313,7 @@ void OpenDialog::FilePanel( HWND hwnd )
} }
void OpenDialog::NetPanel( HWND hwnd ) void OpenDialog::NetPanel( HWND hwnd )
{ {
INITCOMMONCONTROLSEX ic; INITCOMMONCONTROLSEX ic;
TCHAR psz_text[256]; TCHAR psz_text[256];
...@@ -343,7 +331,7 @@ void OpenDialog::NetPanel( HWND hwnd ) ...@@ -343,7 +331,7 @@ void OpenDialog::NetPanel( HWND hwnd )
{ _T("RTSP"), 30 } { _T("RTSP"), 30 }
}; };
RECT rc; RECT rc;
GetWindowRect( notebook, &rc); GetWindowRect( notebook, &rc);
/* UDP/RTP row */ /* UDP/RTP row */
...@@ -474,7 +462,7 @@ void OpenDialog::NetPanel( HWND hwnd ) ...@@ -474,7 +462,7 @@ void OpenDialog::NetPanel( HWND hwnd )
void OpenDialog::UpdateMRL() void OpenDialog::UpdateMRL()
{ {
UpdateMRL( i_current_access_method ); UpdateMRL( i_access );
} }
void OpenDialog::UpdateMRL( int i_access_method ) void OpenDialog::UpdateMRL( int i_access_method )
...@@ -483,7 +471,7 @@ void OpenDialog::UpdateMRL( int i_access_method ) ...@@ -483,7 +471,7 @@ void OpenDialog::UpdateMRL( int i_access_method )
TCHAR psz_text[2048]; TCHAR psz_text[2048];
char psz_tmp[256]; char psz_tmp[256];
i_current_access_method = i_access_method; i_access = i_access_method;
switch( i_access_method ) switch( i_access_method )
{ {
...@@ -567,7 +555,7 @@ void OpenDialog::OnPageChange() ...@@ -567,7 +555,7 @@ void OpenDialog::OnPageChange()
SetWindowPos( subsfile_button, HWND_TOP, 0, 0, 0, 0, SetWindowPos( subsfile_button, HWND_TOP, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE ); SWP_NOMOVE | SWP_NOSIZE );
i_current_access_method = FILE_ACCESS; i_access = FILE_ACCESS;
} }
else if ( TabCtrl_GetCurSel( notebook ) == 1 ) else if ( TabCtrl_GetCurSel( notebook ) == 1 )
{ {
...@@ -599,7 +587,7 @@ void OpenDialog::OnPageChange() ...@@ -599,7 +587,7 @@ void OpenDialog::OnPageChange()
SendMessage( net_radios[0], BM_SETCHECK, BST_CHECKED, 0 ); SendMessage( net_radios[0], BM_SETCHECK, BST_CHECKED, 0 );
i_current_access_method = NET_ACCESS; i_access = NET_ACCESS;
} }
UpdateMRL(); UpdateMRL();
...@@ -675,53 +663,44 @@ void OpenDialog::OnFilePanelChange() ...@@ -675,53 +663,44 @@ void OpenDialog::OnFilePanelChange()
UpdateMRL( FILE_ACCESS ); UpdateMRL( FILE_ACCESS );
} }
void OpenDialog::OnFileBrowse() static void OnOpenCB( intf_dialog_args_t *p_arg )
{ {
OPENFILENAME ofn; OpenDialog *p_this = (OpenDialog *)p_arg->p_arg;
static TCHAR szFilter[] = _T("All (*.*)\0*.*\0"); char psz_tmp[PATH_MAX+2] = "\0";
TCHAR psz_file[PATH_MAX] = _T("\0");
TCHAR psz_tmp[PATH_MAX+2] = _T("\0"); if( p_arg->i_results && p_arg->psz_results[0] )
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof (OPENFILENAME);
ofn.hwndOwner = NULL;
ofn.hInstance = hInst;
ofn.lpstrFilter = szFilter;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 1;
ofn.lpstrFile = psz_file;
ofn.nMaxFile = PATH_MAX;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Open File");
ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
ofn.lCustData = 0L;
ofn.lpfnHook = NULL;
ofn.lpTemplateName = NULL;
if( GetOpenFile( &ofn ) )
{ {
if( _tcschr( ofn.lpstrFile, _T(' ') ) ) if( strchr( p_arg->psz_results[0], ' ' ) )
{ {
_tcscat( psz_tmp, _T("\"") ); strcat( psz_tmp, "\"" );
_tcscat( psz_tmp, ofn.lpstrFile ); strcat( psz_tmp, p_arg->psz_results[0] );
_tcscat( psz_tmp, _T("\"") ); strcat( psz_tmp, "\"" );
} }
else _tcscat( psz_tmp, ofn.lpstrFile ); else strcat( psz_tmp, p_arg->psz_results[0] );
SetWindowText( file_combo, psz_tmp ); SetWindowText( p_this->file_combo, _FROMMB(psz_tmp) );
ComboBox_AddString( file_combo, psz_tmp ); ComboBox_AddString( p_this->file_combo, _FROMMB(psz_tmp) );
if( ComboBox_GetCount( file_combo ) > 10 ) if( ComboBox_GetCount( p_this->file_combo ) > 10 )
ComboBox_DeleteString( file_combo, 0 ); ComboBox_DeleteString( p_this->file_combo, 0 );
UpdateMRL( FILE_ACCESS ); p_this->UpdateMRL( FILE_ACCESS );
} }
} }
void OpenDialog::OnFileBrowse()
{
intf_dialog_args_t *p_arg =
(intf_dialog_args_t *)malloc( sizeof(intf_dialog_args_t) );
memset( p_arg, 0, sizeof(intf_dialog_args_t) );
p_arg->psz_title = strdup( "Open file" );
p_arg->psz_extensions = strdup( "All (*.*)|*.*" );
p_arg->p_arg = this;
p_arg->pf_callback = OnOpenCB;
p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_FILE_GENERIC, 0, p_arg);
}
/***************************************************************************** /*****************************************************************************
* Net panel event methods. * Net panel event methods.
*****************************************************************************/ *****************************************************************************/
...@@ -818,7 +797,7 @@ void OpenDialog::OnSubsFileSettings( HWND hwnd ) ...@@ -818,7 +797,7 @@ void OpenDialog::OnSubsFileSettings( HWND hwnd )
{ {
/* Show/hide the open dialog */ /* Show/hide the open dialog */
SubsFileDialog *subsfile_dialog = new SubsFileDialog( p_intf, hInst ); SubsFileDialog *subsfile_dialog = new SubsFileDialog( p_intf, this, hInst);
CreateDialogBox( hwnd, subsfile_dialog ); CreateDialogBox( hwnd, subsfile_dialog );
subsfile_mrl.clear(); subsfile_mrl.clear();
......
This diff is collapsed.
...@@ -142,11 +142,11 @@ public: ...@@ -142,11 +142,11 @@ public:
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst ) PrefsDialog::PrefsDialog( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst )
: CBaseWindow( p_intf, p_parent, h_inst )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf;
hInst = _hInst;
prefs_tree = NULL; prefs_tree = NULL;
} }
...@@ -226,6 +226,10 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -226,6 +226,10 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
EndDialog( hwnd, LOWORD( wp ) ); EndDialog( hwnd, LOWORD( wp ) );
break; break;
case WM_SETFOCUS:
SHFullScreen( hwnd, SHFS_SHOWSIPBUTTON );
break;
case WM_COMMAND: case WM_COMMAND:
if( LOWORD(wp) == IDOK ) if( LOWORD(wp) == IDOK )
{ {
......
...@@ -46,11 +46,10 @@ ...@@ -46,11 +46,10 @@
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst ) SubsFileDialog::SubsFileDialog( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst )
: CBaseWindow( p_intf, p_parent, h_inst )
{ {
/* Initializations */
p_intf = _p_intf;
hInst = _hInst;
} }
/*********************************************************************** /***********************************************************************
...@@ -223,6 +222,10 @@ LRESULT SubsFileDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -223,6 +222,10 @@ LRESULT SubsFileDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
EndDialog( hwnd, LOWORD( wp ) ); EndDialog( hwnd, LOWORD( wp ) );
break; break;
case WM_SETFOCUS:
SHFullScreen( hwnd, SHFS_SHOWSIPBUTTON );
break;
case WM_COMMAND: case WM_COMMAND:
if ( LOWORD(wp) == IDOK ) if ( LOWORD(wp) == IDOK )
{ {
...@@ -278,38 +281,30 @@ LRESULT SubsFileDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -278,38 +281,30 @@ LRESULT SubsFileDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
/***************************************************************************** /*****************************************************************************
* Events methods. * Events methods.
*****************************************************************************/ *****************************************************************************/
void SubsFileDialog::OnFileBrowse() static void OnOpenCB( intf_dialog_args_t *p_arg )
{ {
OPENFILENAME ofn; SubsFileDialog *p_this = (SubsFileDialog *)p_arg->p_arg;
TCHAR DateiName[80+1] = _T("\0");
static TCHAR szFilter[] = _T("All (*.*)\0*.*\0"); if( p_arg->i_results && p_arg->psz_results[0] )
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof (OPENFILENAME);
ofn.hwndOwner = NULL;
ofn.hInstance = hInst;
ofn.lpstrFilter = szFilter;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 1;
ofn.lpstrFile = (LPTSTR) DateiName;
ofn.nMaxFile = 80;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Open File");
ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
ofn.lCustData = 0L;
ofn.lpfnHook = NULL;
ofn.lpTemplateName = NULL;
if( GetOpenFile( &ofn ) )
{ {
SetWindowText( file_combo, ofn.lpstrFile ); SetWindowText( p_this->file_combo, _FROMMB(p_arg->psz_results[0]) );
ComboBox_AddString( file_combo, ofn.lpstrFile ); ComboBox_AddString( p_this->file_combo,
if( ComboBox_GetCount( file_combo ) > 10 ) _FROMMB(p_arg->psz_results[0]) );
ComboBox_DeleteString( file_combo, 0 ); if( ComboBox_GetCount( p_this->file_combo ) > 10 )
ComboBox_DeleteString( p_this->file_combo, 0 );
} }
} }
void SubsFileDialog::OnFileBrowse()
{
intf_dialog_args_t *p_arg =
(intf_dialog_args_t *)malloc( sizeof(intf_dialog_args_t) );
memset( p_arg, 0, sizeof(intf_dialog_args_t) );
p_arg->psz_title = strdup( "Open file" );
p_arg->psz_extensions = strdup( "All|*.*" );
p_arg->p_arg = this;
p_arg->pf_callback = OnOpenCB;
p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_FILE_GENERIC, 0, p_arg);
}
...@@ -197,13 +197,11 @@ LRESULT VideoWindow::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -197,13 +197,11 @@ LRESULT VideoWindow::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
switch( msg ) switch( msg )
{ {
case WM_KILLFOCUS: case WM_KILLFOCUS:
msg_Err( p_intf, "WM_KILLFOCUS1" );
if( p_vout ) if( p_vout )
vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_FALSE ); vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_FALSE );
return TRUE; return TRUE;
case WM_SETFOCUS: case WM_SETFOCUS:
msg_Err( p_intf, "WM_SETFOCUS1" );
if( p_vout ) if( p_vout )
vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_TRUE ); vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_TRUE );
return TRUE; return TRUE;
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
#include "wince.h" #include "wince.h"
#include <objbase.h> #include <objbase.h>
#include <commctrl.h>
#include <commdlg.h>
/***************************************************************************** /*****************************************************************************
* Local prototypes. * Local prototypes.
...@@ -46,6 +44,11 @@ static int Open ( vlc_object_t * ); ...@@ -46,6 +44,11 @@ static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
static void Run ( intf_thread_t * ); static void Run ( intf_thread_t * );
static int OpenDialogs( vlc_object_t * );
static void MainLoop ( intf_thread_t * );
static void ShowDialog( intf_thread_t *, int, int, intf_dialog_args_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
...@@ -62,6 +65,11 @@ vlc_module_begin(); ...@@ -62,6 +65,11 @@ vlc_module_begin();
add_bool( "wince-embed", 1, NULL, add_bool( "wince-embed", 1, NULL,
EMBED_TEXT, EMBED_LONGTEXT, VLC_FALSE ); EMBED_TEXT, EMBED_LONGTEXT, VLC_FALSE );
add_submodule();
set_description( _("WinCE dialogs provider") );
set_capability( "dialogs provider", 10 );
set_callbacks( OpenDialogs, Close );
vlc_module_end(); vlc_module_end();
HINSTANCE hInstance = 0; HINSTANCE hInstance = 0;
...@@ -113,6 +121,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -113,6 +121,7 @@ static int Open( vlc_object_t *p_this )
p_intf->p_sys->p_settings_menu = NULL; p_intf->p_sys->p_settings_menu = NULL;
p_intf->pf_run = Run; p_intf->pf_run = Run;
p_intf->pf_show_dialog = NULL;
p_intf->p_sys->p_input = NULL; p_intf->p_sys->p_input = NULL;
p_intf->p_sys->b_playing = 0; p_intf->p_sys->b_playing = 0;
...@@ -120,19 +129,17 @@ static int Open( vlc_object_t *p_this ) ...@@ -120,19 +129,17 @@ static int Open( vlc_object_t *p_this )
p_intf->p_sys->b_slider_free = 1; p_intf->p_sys->b_slider_free = 1;
p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_oldpos = 0; p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_oldpos = 0;
p_intf->p_sys->GetOpenFile = 0; return VLC_SUCCESS;
p_intf->p_sys->h_gsgetfile_dll = LoadLibrary( _T("gsgetfile") ); }
if( p_intf->p_sys->h_gsgetfile_dll )
{ static int OpenDialogs( vlc_object_t *p_this )
p_intf->p_sys->GetOpenFile = (BOOL (WINAPI *)(void *)) {
GetProcAddress( p_intf->p_sys->h_gsgetfile_dll, intf_thread_t *p_intf = (intf_thread_t *)p_this;
_T("gsGetOpenFileName") ); int i_ret = Open( p_this );
}
if( !p_intf->p_sys->GetOpenFile ) p_intf->pf_show_dialog = ShowDialog;
p_intf->p_sys->GetOpenFile = (BOOL (WINAPI *)(void *))GetOpenFileName;
return VLC_SUCCESS; return i_ret;
} }
/***************************************************************************** /*****************************************************************************
...@@ -156,12 +163,19 @@ static void Close( vlc_object_t *p_this ) ...@@ -156,12 +163,19 @@ static void Close( vlc_object_t *p_this )
MenuItemExt::ClearList( p_intf->p_sys->p_navig_menu ); MenuItemExt::ClearList( p_intf->p_sys->p_navig_menu );
delete p_intf->p_sys->p_navig_menu; delete p_intf->p_sys->p_navig_menu;
if( p_intf->pf_show_dialog )
{
/* We must destroy the dialogs thread */
#if 0
wxCommandEvent event( wxEVT_DIALOG, INTF_DIALOG_EXIT );
p_intf->p_sys->p_wxwindow->AddPendingEvent( event );
#endif
vlc_thread_join( p_intf );
}
// Unsuscribe to messages bank // Unsuscribe to messages bank
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub ); msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
if( p_intf->p_sys->h_gsgetfile_dll )
FreeLibrary( p_intf->p_sys->h_gsgetfile_dll );
// Destroy structure // Destroy structure
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
...@@ -170,6 +184,27 @@ static void Close( vlc_object_t *p_this ) ...@@ -170,6 +184,27 @@ static void Close( vlc_object_t *p_this )
* Run: main loop * Run: main loop
*****************************************************************************/ *****************************************************************************/
static void Run( intf_thread_t *p_intf ) static void Run( intf_thread_t *p_intf )
{
if( p_intf->pf_show_dialog )
{
/* The module is used in dialog provider mode */
/* Create a new thread for the dialogs provider */
if( vlc_thread_create( p_intf, "Skins Dialogs Thread",
MainLoop, 0, VLC_TRUE ) )
{
msg_Err( p_intf, "cannot create Skins Dialogs Thread" );
p_intf->pf_show_dialog = NULL;
}
}
else
{
/* The module is used in interface mode */
MainLoop( p_intf );
}
}
static void MainLoop( intf_thread_t *p_intf )
{ {
MSG msg; MSG msg;
Interface intf; Interface intf;
...@@ -177,12 +212,63 @@ static void Run( intf_thread_t *p_intf ) ...@@ -177,12 +212,63 @@ static void Run( intf_thread_t *p_intf )
p_intf->p_sys->p_main_window = &intf; p_intf->p_sys->p_main_window = &intf;
if( !hInstance ) hInstance = GetModuleHandle(NULL); if( !hInstance ) hInstance = GetModuleHandle(NULL);
// Register window class
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW ;
wc.lpfnWndProc = (WNDPROC)CBaseWindow::BaseWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hIcon = NULL;
wc.hInstance = hInstance;
wc.hCursor = NULL;
wc.hbrBackground = (HBRUSH)(COLOR_MENU+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = _T("VLC WinCE");
RegisterClass( &wc );
#ifndef UNDER_CE #ifndef UNDER_CE
/* Initialize OLE/COM */ /* Initialize OLE/COM */
CoInitialize( 0 ); CoInitialize( 0 );
#endif #endif
if( !intf.InitInstance( hInstance, p_intf ) ) return; if( !p_intf->pf_show_dialog )
{
/* The module is used in interface mode */
p_intf->p_sys->p_window = &intf;
/* Create/Show the interface */
if( !intf.InitInstance( hInstance, p_intf ) )
{
#ifndef UNDER_CE
/* Uninitialize OLE/COM */
CoUninitialize();
#endif
return;
}
}
/* Creates the dialogs provider */
p_intf->p_sys->p_window =
CreateDialogsProvider( p_intf, p_intf->pf_show_dialog ?
NULL : p_intf->p_sys->p_window, hInstance );
p_intf->p_sys->pf_show_dialog = ShowDialog;
/* OK, initialization is over */
vlc_thread_ready( p_intf );
/* Check if we need to start playing */
if( !p_intf->pf_show_dialog && p_intf->b_play )
{
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist )
{
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
}
// Main message loop // Main message loop
while( GetMessage( &msg, NULL, 0, 0 ) > 0 ) while( GetMessage( &msg, NULL, 0, 0 ) > 0 )
...@@ -196,3 +282,74 @@ static void Run( intf_thread_t *p_intf ) ...@@ -196,3 +282,74 @@ static void Run( intf_thread_t *p_intf )
CoUninitialize(); CoUninitialize();
#endif #endif
} }
/*****************************************************************************
* CBaseWindow Implementation
*****************************************************************************/
LRESULT CALLBACK CBaseWindow::BaseWndProc( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam )
{
CBaseWindow *p_obj;
// check to see if a copy of the 'this' pointer needs to be saved
if( msg == WM_CREATE )
{
p_obj = (CBaseWindow *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
SetWindowLong( hwnd, GWL_USERDATA,
(LONG)((LPCREATESTRUCT)lParam)->lpCreateParams );
p_obj->hWnd = hwnd;
}
if( msg == WM_INITDIALOG )
{
p_obj = (CBaseWindow *)lParam;
SetWindowLong( hwnd, GWL_USERDATA, lParam );
p_obj->hWnd = hwnd;
}
// Retrieve the pointer
p_obj = (CBaseWindow *)GetWindowLong( hwnd, GWL_USERDATA );
if( !p_obj ) return DefWindowProc( hwnd, msg, wParam, lParam );
// Filter message through child classes
return p_obj->WndProc( hwnd, msg, wParam, lParam );
}
int CBaseWindow::CreateDialogBox( HWND hwnd, CBaseWindow *p_obj )
{
uint8_t p_buffer[sizeof(DLGTEMPLATE) + sizeof(WORD) * 4];
DLGTEMPLATE *p_dlg_template = (DLGTEMPLATE *)p_buffer;
memset( p_dlg_template, 0, sizeof(DLGTEMPLATE) + sizeof(WORD) * 4 );
// these values are arbitrary, they won't be used normally anyhow
p_dlg_template->x = 0; p_dlg_template->y = 0;
p_dlg_template->cx = 300; p_dlg_template->cy = 300;
p_dlg_template->style =
DS_MODALFRAME|WS_POPUP|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX;
return DialogBoxIndirectParam( GetModuleHandle(0), p_dlg_template, hwnd,
(DLGPROC)p_obj->BaseWndProc, (LPARAM)p_obj);
}
/*****************************************************************************
* ShowDialog
*****************************************************************************/
static void ShowDialog( intf_thread_t *p_intf, int i_dialog_event, int i_arg,
intf_dialog_args_t *p_arg )
{
SendMessage( p_intf->p_sys->p_window->GetHandle(), WM_CANCELMODE, 0, 0 );
if( i_dialog_event == INTF_DIALOG_POPUPMENU && i_arg == 0 ) return;
/* Hack to prevent popup events to be enqueued when
* one is already active */
#if 0
if( i_dialog_event != INTF_DIALOG_POPUPMENU ||
!p_intf->p_sys->p_popup_menu )
#endif
{
SendMessage( p_intf->p_sys->p_window->GetHandle(),
WM_APP + i_dialog_event, (WPARAM)i_arg, (LPARAM)p_arg );
}
}
...@@ -55,6 +55,9 @@ class VideoWindow; ...@@ -55,6 +55,9 @@ class VideoWindow;
*****************************************************************************/ *****************************************************************************/
struct intf_sys_t struct intf_sys_t
{ {
/* the parent window */
CBaseWindow *p_window;
/* special actions */ /* special actions */
vlc_bool_t b_playing; vlc_bool_t b_playing;
...@@ -85,14 +88,8 @@ struct intf_sys_t ...@@ -85,14 +88,8 @@ struct intf_sys_t
vector<MenuItemExt*> *p_settings_menu; vector<MenuItemExt*> *p_settings_menu;
VideoWindow *p_video_window; VideoWindow *p_video_window;
/* GetOpenFileName replacement */
BOOL (WINAPI *GetOpenFile)(void *);
HMODULE h_gsgetfile_dll;
}; };
#define GetOpenFile(a) p_intf->p_sys->GetOpenFile(a)
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
...@@ -100,7 +97,9 @@ struct intf_sys_t ...@@ -100,7 +97,9 @@ struct intf_sys_t
class CBaseWindow class CBaseWindow
{ {
public: public:
CBaseWindow() : hWnd(0), hInst(0) {}; CBaseWindow( intf_thread_t *_p_intf = 0, CBaseWindow *_p_parent = 0,
HINSTANCE _hInst = 0 )
: hWnd(0), hInst(_hInst), p_parent(_p_parent), p_intf(_p_intf) {};
virtual ~CBaseWindow() {}; virtual ~CBaseWindow() {};
HWND hWnd; // The main window handle HWND hWnd; // The main window handle
...@@ -108,6 +107,10 @@ public: ...@@ -108,6 +107,10 @@ public:
static LRESULT CALLBACK BaseWndProc( HWND, UINT, WPARAM, LPARAM ); static LRESULT CALLBACK BaseWndProc( HWND, UINT, WPARAM, LPARAM );
static int CreateDialogBox( HWND, CBaseWindow * ); static int CreateDialogBox( HWND, CBaseWindow * );
HWND GetHandle() { return hWnd; }
BOOL Show( BOOL b_show ) { return (hWnd && ShowWindow(hWnd, b_show)); }
BOOL IsShown( void ) { return (hWnd && IsWindowVisible(hWnd)); }
protected: protected:
HINSTANCE hInst; // The current instance HINSTANCE hInst; // The current instance
...@@ -116,7 +119,8 @@ protected: ...@@ -116,7 +119,8 @@ protected:
HINSTANCE GetInstance () const { return hInst; } HINSTANCE GetInstance () const { return hInst; }
virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ) { return 0; }; virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ) { return 0; };
intf_thread_t *p_intf; CBaseWindow *p_parent;
intf_thread_t *p_intf;
}; };
class FileInfo; class FileInfo;
...@@ -126,6 +130,7 @@ class Timer; ...@@ -126,6 +130,7 @@ class Timer;
class OpenDialog; class OpenDialog;
class PrefsDialog; class PrefsDialog;
CBaseWindow *CreateDialogsProvider( intf_thread_t *, CBaseWindow *, HINSTANCE);
CBaseWindow *CreateVideoWindow( intf_thread_t *, HWND ); CBaseWindow *CreateVideoWindow( intf_thread_t *, HWND );
void PopupMenu( intf_thread_t *, HWND, POINT ); void PopupMenu( intf_thread_t *, HWND, POINT );
...@@ -154,33 +159,28 @@ public: ...@@ -154,33 +159,28 @@ public:
HMENU hPopUpMenu; HMENU hPopUpMenu;
HMENU hMenu; HMENU hMenu;
FileInfo *fileinfo;
Messages *messages;
PrefsDialog *preferences;
Playlist *playlist;
Timer *timer; Timer *timer;
OpenDialog *open;
CBaseWindow *video; CBaseWindow *video;
protected: protected:
virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ); virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
void OnOpenFileSimple( void ); void OnShowDialog( int );
void OnOpenDirectory( void );
void OnPlayStream( void );
void OnVideoOnTop( void );
void OnSliderUpdate( int wp ); void OnPlayStream( void );
void OnChange( int wp );
void VolumeChange( int i_volume );
void VolumeUpdate( void );
void OnStopStream( void ); void OnStopStream( void );
void OnPrevStream( void ); void OnPrevStream( void );
void OnNextStream( void ); void OnNextStream( void );
void OnSlowStream( void ); void OnSlowStream( void );
void OnFastStream( void ); void OnFastStream( void );
void OnVideoOnTop( void );
void OnSliderUpdate( int wp );
void OnChange( int wp );
void VolumeChange( int i_volume );
void VolumeUpdate( void );
int i_old_playing_status; int i_old_playing_status;
private: private:
...@@ -197,9 +197,11 @@ class FileInfo : public CBaseWindow ...@@ -197,9 +197,11 @@ class FileInfo : public CBaseWindow
{ {
public: public:
/* Constructor */ /* Constructor */
FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst ); FileInfo( intf_thread_t *, CBaseWindow *, HINSTANCE );
virtual ~FileInfo(){}; virtual ~FileInfo(){};
void UpdateFileInfo(void);
protected: protected:
HWND hwnd_fileinfo; // handle to fileinfo window HWND hwnd_fileinfo; // handle to fileinfo window
...@@ -209,7 +211,6 @@ protected: ...@@ -209,7 +211,6 @@ protected:
TCHAR szFileInfoTitle[100]; // Main window name TCHAR szFileInfoTitle[100]; // Main window name
virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ); virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
void UpdateFileInfo( HWND );
BOOL CreateTreeView( HWND ); BOOL CreateTreeView( HWND );
}; };
...@@ -218,16 +219,16 @@ class Messages : public CBaseWindow ...@@ -218,16 +219,16 @@ class Messages : public CBaseWindow
{ {
public: public:
/* Constructor */ /* Constructor */
Messages( intf_thread_t *_p_intf, HINSTANCE _hInst ); Messages( intf_thread_t *, CBaseWindow *, HINSTANCE );
virtual ~Messages(){}; virtual ~Messages(){};
void UpdateLog(void);
protected: protected:
virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ); virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
HWND hListView; HWND hListView;
void UpdateLog(void);
vlc_bool_t b_verbose; vlc_bool_t b_verbose;
}; };
...@@ -236,7 +237,8 @@ class ItemInfoDialog : public CBaseWindow ...@@ -236,7 +237,8 @@ class ItemInfoDialog : public CBaseWindow
{ {
public: public:
/* Constructor */ /* Constructor */
ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * ); ItemInfoDialog( intf_thread_t *, CBaseWindow *,
HINSTANCE, playlist_item_t * );
virtual ~ItemInfoDialog(){}; virtual ~ItemInfoDialog(){};
protected: protected:
...@@ -271,13 +273,14 @@ class OpenDialog : public CBaseWindow ...@@ -271,13 +273,14 @@ class OpenDialog : public CBaseWindow
{ {
public: public:
/* Constructor */ /* Constructor */
OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst, OpenDialog( intf_thread_t *, CBaseWindow *, HINSTANCE, int, int );
int _i_access_method, int _i_arg, int _i_method );
virtual ~OpenDialog(){}; virtual ~OpenDialog(){};
void UpdateMRL(); void UpdateMRL();
void UpdateMRL( int i_access_method ); void UpdateMRL( int i_access_method );
HWND file_combo;
protected: protected:
virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ); virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
...@@ -289,7 +292,6 @@ protected: ...@@ -289,7 +292,6 @@ protected:
HWND notebook; HWND notebook;
HWND file_combo;
HWND browse_button; HWND browse_button;
HWND subsfile_checkbox; HWND subsfile_checkbox;
HWND subsfile_label; HWND subsfile_label;
...@@ -306,12 +308,11 @@ protected: ...@@ -306,12 +308,11 @@ protected:
HWND net_addrs_label[4]; HWND net_addrs_label[4];
HWND net_addrs[4]; HWND net_addrs[4];
int i_current_access_method;
int i_method; /* Normal or for the stream dialog ? */
int i_open_arg; int i_open_arg;
int i_access;
int i_net_type; int i_net_type;
void FilePanel( HWND hwnd ); void FilePanel( HWND hwnd );
void NetPanel( HWND hwnd ); void NetPanel( HWND hwnd );
...@@ -337,16 +338,16 @@ class SubsFileDialog: public CBaseWindow ...@@ -337,16 +338,16 @@ class SubsFileDialog: public CBaseWindow
{ {
public: public:
/* Constructor */ /* Constructor */
SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst ); SubsFileDialog( intf_thread_t *, CBaseWindow *, HINSTANCE );
virtual ~SubsFileDialog(){}; virtual ~SubsFileDialog(){};
vector<string> subsfile_mrl; vector<string> subsfile_mrl;
HWND file_combo;
protected: protected:
friend class OpenDialog; friend class OpenDialog;
HWND file_box; HWND file_box;
HWND file_combo;
HWND browse_button; HWND browse_button;
HWND enc_box; HWND enc_box;
...@@ -372,9 +373,12 @@ class Playlist : public CBaseWindow ...@@ -372,9 +373,12 @@ class Playlist : public CBaseWindow
{ {
public: public:
/* Constructor */ /* Constructor */
Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst ); Playlist( intf_thread_t *, CBaseWindow *, HINSTANCE );
virtual ~Playlist(){}; virtual ~Playlist(){};
void UpdatePlaylist();
void ShowPlaylist( bool );
protected: protected:
bool b_need_update; bool b_need_update;
...@@ -387,7 +391,6 @@ protected: ...@@ -387,7 +391,6 @@ protected:
HWND hwndTB; // Handle to the toolbar. HWND hwndTB; // Handle to the toolbar.
HWND hListView; HWND hListView;
void UpdatePlaylist();
void Rebuild(); void Rebuild();
void UpdateItem( int ); void UpdateItem( int );
LRESULT ProcessCustomDraw( LPARAM lParam ); LRESULT ProcessCustomDraw( LPARAM lParam );
...@@ -397,8 +400,6 @@ protected: ...@@ -397,8 +400,6 @@ protected:
void OnOpen(); void OnOpen();
void OnSave(); void OnSave();
void OnAddFile();
void OnAddMRL();
void OnDeleteSelection(); void OnDeleteSelection();
void OnInvertSelection(); void OnInvertSelection();
...@@ -431,7 +432,7 @@ class Timer ...@@ -431,7 +432,7 @@ class Timer
{ {
public: public:
/* Constructor */ /* Constructor */
Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface); Timer( intf_thread_t *p_intf, HWND hwnd, Interface *_p_main_interface );
virtual ~Timer(); virtual ~Timer();
void Notify( void ); void Notify( void );
...@@ -491,7 +492,7 @@ class PrefsDialog: public CBaseWindow ...@@ -491,7 +492,7 @@ class PrefsDialog: public CBaseWindow
{ {
public: public:
/* Constructor */ /* Constructor */
PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst ); PrefsDialog( intf_thread_t *, CBaseWindow *, HINSTANCE );
virtual ~PrefsDialog(){}; virtual ~PrefsDialog(){};
protected: protected:
...@@ -547,6 +548,7 @@ protected: ...@@ -547,6 +548,7 @@ protected:
*****************************************************************************/ *****************************************************************************/
#define _WIN32_IE 0x0500 #define _WIN32_IE 0x0500
#define SHFS_SHOWSIPBUTTON 0x0004
#define SHFS_HIDESIPBUTTON 0x0008 #define SHFS_HIDESIPBUTTON 0x0008
#define SHIDIM_FLAGS 0x0001 #define SHIDIM_FLAGS 0x0001
#define SHIDIF_DONEBUTTON 0x0001 #define SHIDIF_DONEBUTTON 0x0001
...@@ -554,7 +556,6 @@ protected: ...@@ -554,7 +556,6 @@ protected:
#define SHIDIF_FULLSCREENNOMENUBAR 0x0010 #define SHIDIF_FULLSCREENNOMENUBAR 0x0010
#define SHCMBF_HMENU 0x0010 #define SHCMBF_HMENU 0x0010
#define SHCMBF_EMPTYBAR 0x0001 #define SHCMBF_EMPTYBAR 0x0001
#define SHFS_SHOWSIPBUTTON 0x0004
#define GN_CONTEXTMENU 1000 #define GN_CONTEXTMENU 1000
#define SHRG_RETURNCMD 0x0001 #define SHRG_RETURNCMD 0x0001
#define SHRG_NOTIFYPARENT 0x0002 #define SHRG_NOTIFYPARENT 0x0002
...@@ -613,6 +614,29 @@ extern "C" { ...@@ -613,6 +614,29 @@ extern "C" {
} SHRGINFO, *PSHRGINFO; } SHRGINFO, *PSHRGINFO;
DWORD SHRecognizeGesture(SHRGINFO *shrg); DWORD SHRecognizeGesture(SHRGINFO *shrg);
typedef enum tagSIPSTATE
{
SIP_UP = 0,
SIP_DOWN,
SIP_FORCEDOWN,
SIP_UNCHANGED,
SIP_INPUTDIALOG,
} SIPSTATE;
BOOL SHSipPreference(HWND, SIPSTATE);
BOOL SHSipInfo(UINT, UINT, PVOID, UINT);
typedef struct
{
DWORD cbSize;
DWORD fdwFlags;
RECT rcVisibleDesktop;
RECT rcSipRect;
DWORD dwImDataSize;
VOID *pvImData;
} SIPINFO;
} }
#if defined( WIN32 ) && !defined( UNDER_CE ) #if defined( WIN32 ) && !defined( UNDER_CE )
...@@ -620,6 +644,9 @@ extern "C" { ...@@ -620,6 +644,9 @@ extern "C" {
# define SHInitDialog(a) # define SHInitDialog(a)
# define SHCreateMenuBar(a) 1 # define SHCreateMenuBar(a) 1
# define SHRecognizeGesture(a) 0 # define SHRecognizeGesture(a) 0
# define SHSipPreference(a,b)
# define SHSipInfo(a,b,c,d) 0
#endif #endif
#endif //WINCE_RESOURCE #endif //WINCE_RESOURCE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment