Commit 9abc1276 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince: cleanup + ported to win32 (but not tried yet ;).

parent 78d2cf9c
...@@ -76,13 +76,13 @@ BOOL FileInfo::CreateTreeView(HWND hwnd) ...@@ -76,13 +76,13 @@ BOOL FileInfo::CreateTreeView(HWND hwnd)
// Assign the window styles for the tree view. // Assign the window styles for the tree view.
dwStyle = WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT | dwStyle = WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT |
TVS_HASBUTTONS; TVS_HASBUTTONS;
// Create the tree-view control. // Create the tree-view control.
hwndTV = CreateWindowEx( 0, WC_TREEVIEW, NULL, dwStyle, 0, MENU_HEIGHT, hwndTV = CreateWindowEx( 0, WC_TREEVIEW, NULL, dwStyle, 0, MENU_HEIGHT,
rect.right-rect.left, rect.right-rect.left,
rect.bottom-rect.top-MENU_HEIGHT, rect.bottom-rect.top-MENU_HEIGHT,
hwnd, NULL, hInst, NULL ); hwnd, NULL, hInst, NULL );
// 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;
...@@ -140,40 +140,40 @@ void FileInfo::UpdateFileInfo(HWND hwnd) ...@@ -140,40 +140,40 @@ void FileInfo::UpdateFileInfo(HWND hwnd)
info_category_t *p_cat = p_input->input.p_item->pp_categories[i]; info_category_t *p_cat = p_input->input.p_item->pp_categories[i];
// Set the text of the item. // Set the text of the item.
tvi.pszText = _FROMMB( p_input->input.p_item->psz_name ); tvi.pszText = _FROMMB( p_input->input.p_item->psz_name );
tvi.cchTextMax = _tcslen( tvi.pszText ); tvi.cchTextMax = _tcslen( tvi.pszText );
// Save the heading level in the item's application-defined data area // Save the heading level in the item's application-defined data area
tvi.lParam = (LPARAM)2; // level 2 tvi.lParam = (LPARAM)2; // level 2
tvins.item = tvi; tvins.item = tvi;
tvins.hInsertAfter = hPrev; tvins.hInsertAfter = hPrev;
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( hwnd, &tvins );
hPrevLev2Item = hPrev; hPrevLev2Item = hPrev;
for( int j = 0; j < p_cat->i_infos; j++ ) for( int j = 0; j < p_cat->i_infos; j++ )
{ {
info_t *p_info = p_cat->pp_infos[j]; info_t *p_info = p_cat->pp_infos[j];
// Set the text of the item. // Set the text of the item.
string szAnsi = (string)p_info->psz_name; string szAnsi = (string)p_info->psz_name;
szAnsi += ": "; szAnsi += ": ";
szAnsi += p_info->psz_value; szAnsi += p_info->psz_value;
tvi.pszText = _FROMMB( szAnsi.c_str() ); tvi.pszText = (TCHAR *)_FROMMB( szAnsi.c_str() );
tvi.cchTextMax = _tcslen( tvi.pszText ); tvi.cchTextMax = _tcslen( tvi.pszText );
tvi.lParam = (LPARAM)3; // level 3 tvi.lParam = (LPARAM)3; // level 3
tvins.item = tvi; tvins.item = tvi;
tvins.hInsertAfter = hPrev; tvins.hInsertAfter = hPrev;
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( hwnd, &tvins );
} }
TreeView_Expand( hwnd, hPrevLev2Item, TVE_EXPANDPARTIAL |TVE_EXPAND ); TreeView_Expand( hwnd, hPrevLev2Item, TVE_EXPANDPARTIAL |TVE_EXPAND );
} }
vlc_mutex_unlock( &p_input->input.p_item->lock ); vlc_mutex_unlock( &p_input->input.p_item->lock );
...@@ -192,7 +192,7 @@ PURPOSE: ...@@ -192,7 +192,7 @@ PURPOSE:
***********************************************************************/ ***********************************************************************/
LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
PBOOL pbProcessed ) PBOOL pbProcessed )
{ {
SHINITDLGINFO shidi; SHINITDLGINFO shidi;
...@@ -205,13 +205,13 @@ LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -205,13 +205,13 @@ LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
case WM_INITDIALOG: case WM_INITDIALOG:
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 );
CreateTreeView( hwnd ); CreateTreeView( hwnd );
UpdateWindow( hwnd ); UpdateWindow( hwnd );
SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON ); SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON );
return lResult; return lResult;
case WM_COMMAND: case WM_COMMAND:
if ( LOWORD(wp) == IDOK ) if ( LOWORD(wp) == IDOK )
......
...@@ -81,19 +81,19 @@ ...@@ -81,19 +81,19 @@
// The TBBUTTON structure contains information the toolbar buttons. // The TBBUTTON structure contains information the toolbar buttons.
static TBBUTTON tbButton[] = static TBBUTTON tbButton[] =
{ {
{0, ID_FILE_QUICKOPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {0, ID_FILE_QUICKOPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{1, ID_FILE_OPENNET, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {1, ID_FILE_OPENNET, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{2, StopStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {2, StopStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{3, PlayStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {3, PlayStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{4, ID_VIEW_PLAYLIST, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {4, ID_VIEW_PLAYLIST, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{5, PrevStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {5, PrevStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{6, NextStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {6, NextStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{7, SlowStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {7, SlowStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{8, FastStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {8, FastStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
}; };
// Toolbar ToolTips // Toolbar ToolTips
...@@ -169,7 +169,7 @@ HWND WINAPI Interface::CreateToolbar( HWND hwnd ) ...@@ -169,7 +169,7 @@ HWND WINAPI Interface::CreateToolbar( HWND hwnd )
dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS |
WS_EX_OVERLAPPEDWINDOW | CCS_NOPARENTALIGN; WS_EX_OVERLAPPEDWINDOW | CCS_NOPARENTALIGN;
hwndTB = CreateToolbarEx( hwnd, dwStyle, NULL, NUMIMAGES, hwndTB = CreateToolbarEx( hwnd, dwStyle, 0, NUMIMAGES,
hInst, IDB_BITMAP1, tbButton, sizeof(tbButton) / sizeof(TBBUTTON), hInst, IDB_BITMAP1, tbButton, sizeof(tbButton) / sizeof(TBBUTTON),
BUTTONWIDTH, BUTTONHEIGHT, IMAGEWIDTH, IMAGEHEIGHT, sizeof(TBBUTTON) ); BUTTONWIDTH, BUTTONHEIGHT, IMAGEWIDTH, IMAGEHEIGHT, sizeof(TBBUTTON) );
...@@ -209,7 +209,7 @@ HWND WINAPI Interface::CreateSliderbar( HWND hwnd ) ...@@ -209,7 +209,7 @@ HWND WINAPI Interface::CreateSliderbar( HWND hwnd )
// Registers TRACKBAR_CLASS control classes from the common control dll // Registers TRACKBAR_CLASS control classes from the common control dll
InitCommonControlsEx( &iccex ); InitCommonControlsEx( &iccex );
hwndSlider = CreateWindowEx( NULL, TRACKBAR_CLASS, NULL, hwndSlider = CreateWindowEx( 0, TRACKBAR_CLASS, NULL,
WS_CHILD | WS_VISIBLE | TBS_HORZ | WS_EX_OVERLAPPEDWINDOW | WS_CHILD | WS_VISIBLE | TBS_HORZ | WS_EX_OVERLAPPEDWINDOW |
TBS_BOTTOM, //|WS_CLIPSIBLINGS, TBS_BOTTOM, //|WS_CLIPSIBLINGS,
0, 0, 0, 0, hwnd, NULL, hInst, NULL ); 0, 0, 0, 0, hwnd, NULL, hInst, NULL );
...@@ -274,7 +274,7 @@ HWND WINAPI Interface::CreateVolTrackbar( HWND hwnd ) ...@@ -274,7 +274,7 @@ HWND WINAPI Interface::CreateVolTrackbar( HWND hwnd )
// Registers TRACKBAR_CLASS control classes from the common control dll // Registers TRACKBAR_CLASS control classes from the common control dll
InitCommonControlsEx( &iccex ); InitCommonControlsEx( &iccex );
hwndVol = CreateWindowEx( NULL, TRACKBAR_CLASS, NULL, hwndVol = CreateWindowEx( 0, TRACKBAR_CLASS, NULL,
WS_CHILD | WS_VISIBLE | TBS_VERT | TBS_RIGHT | TBS_AUTOTICKS | WS_CHILD | WS_VISIBLE | TBS_VERT | TBS_RIGHT | TBS_AUTOTICKS |
WS_EX_OVERLAPPEDWINDOW, //|WS_CLIPSIBLINGS, WS_EX_OVERLAPPEDWINDOW, //|WS_CLIPSIBLINGS,
0, 0, 0, 0, hwnd, NULL, hInst, NULL ); 0, 0, 0, 0, hwnd, NULL, hInst, NULL );
...@@ -322,7 +322,7 @@ HWND WINAPI Interface::CreateStatusbar( HWND hwnd ) ...@@ -322,7 +322,7 @@ HWND WINAPI Interface::CreateStatusbar( HWND hwnd )
// Create the statusbar control // Create the statusbar control
dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | CCS_NOPARENTALIGN; dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | CCS_NOPARENTALIGN;
hwndSB = CreateWindowEx( NULL, STATUSCLASSNAME, NULL, hwndSB = CreateWindowEx( 0, STATUSCLASSNAME, NULL,
WS_CHILD | WS_VISIBLE | TBS_VERT | TBS_BOTTOM | WS_CHILD | WS_VISIBLE | TBS_VERT | TBS_BOTTOM |
TBS_RIGHT |WS_CLIPSIBLINGS, TBS_RIGHT |WS_CLIPSIBLINGS,
0, 0, CW_USEDEFAULT, 50, hwnd, NULL, hInst, 0 ); 0, 0, CW_USEDEFAULT, 50, hwnd, NULL, hInst, 0 );
...@@ -416,7 +416,6 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, ...@@ -416,7 +416,6 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
// call the base class first // call the base class first
LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed ); LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed );
BOOL bWasProcessed = *pbProcessed;
*pbProcessed = TRUE; *pbProcessed = TRUE;
switch( msg ) switch( msg )
...@@ -433,7 +432,7 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, ...@@ -433,7 +432,7 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
if( !SHCreateMenuBar(&mbi) ) if( !SHCreateMenuBar(&mbi) )
{ {
MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK); MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
//return -1; //return -1;
} }
...@@ -643,8 +642,8 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, ...@@ -643,8 +642,8 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
return lResult; return lResult;
case WM_DESTROY: case WM_DESTROY:
PostQuitMessage( 0 ); PostQuitMessage( 0 );
return lResult; return lResult;
} }
return DefWindowProc( hwnd, msg, wp, lp ); return DefWindowProc( hwnd, msg, wp, lp );
...@@ -674,7 +673,7 @@ void Interface::OnOpenFileSimple( void ) ...@@ -674,7 +673,7 @@ void Interface::OnOpenFileSimple( void )
ofn.nMaxFileTitle = 40; ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL; ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Quick Open File"); ofn.lpstrTitle = _T("Quick Open File");
ofn.Flags = NULL; ofn.Flags = 0;
ofn.nFileOffset = 0; ofn.nFileOffset = 0;
ofn.nFileExtension = 0; ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL; ofn.lpstrDefExt = NULL;
...@@ -795,7 +794,7 @@ void Interface::OnSliderUpdate( int wp ) ...@@ -795,7 +794,7 @@ void Interface::OnSliderUpdate( int wp )
vlc_mutex_lock( &pIntf->change_lock ); vlc_mutex_lock( &pIntf->change_lock );
input_thread_t *p_input = pIntf->p_sys->p_input; input_thread_t *p_input = pIntf->p_sys->p_input;
DWORD dwPos = SendMessage( hwndSlider, TBM_GETPOS, 0, 0 ); int dwPos = SendMessage( hwndSlider, TBM_GETPOS, 0, 0 );
if( (int)LOWORD(wp) == SB_THUMBPOSITION || if( (int)LOWORD(wp) == SB_THUMBPOSITION ||
(int)LOWORD(wp) == SB_ENDSCROLL ) (int)LOWORD(wp) == SB_ENDSCROLL )
......
...@@ -97,7 +97,7 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -97,7 +97,7 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
if( !SHCreateMenuBar(&mbi) ) if( !SHCreateMenuBar(&mbi) )
{ {
MessageBox( hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK ); MessageBox( hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK );
//return -1; //return -1;
} }
...@@ -235,7 +235,7 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -235,7 +235,7 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
string szAnsi = (string)p_info->psz_name; string szAnsi = (string)p_info->psz_name;
szAnsi += ": "; szAnsi += ": ";
szAnsi += p_info->psz_value; szAnsi += p_info->psz_value;
tvi.pszText = _FROMMB( szAnsi.c_str() ); tvi.pszText = (TCHAR *)_FROMMB( szAnsi.c_str() );
tvi.cchTextMax = _tcslen( tvi.pszText ); tvi.cchTextMax = _tcslen( tvi.pszText );
tvi.lParam = (LPARAM)3; // level 3 tvi.lParam = (LPARAM)3; // level 3
tvins.item = tvi; tvins.item = tvi;
...@@ -259,7 +259,7 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -259,7 +259,7 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
*****************************************************************************/ *****************************************************************************/
void ItemInfoDialog::OnOk() void ItemInfoDialog::OnOk()
{ {
int b_state, i_item; int b_state = VLC_FALSE;
vlc_mutex_lock( &p_item->input.lock ); vlc_mutex_lock( &p_item->input.lock );
......
...@@ -78,8 +78,6 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -78,8 +78,6 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
OPENFILENAME ofn; OPENFILENAME ofn;
int i_dummy; int i_dummy;
HANDLE fichier; HANDLE fichier;
int nList=0;
LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed ); LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed );
BOOL bWasProcessed = *pbProcessed; BOOL bWasProcessed = *pbProcessed;
...@@ -240,7 +238,7 @@ void Messages::UpdateLog() ...@@ -240,7 +238,7 @@ void Messages::UpdateLog()
lv.iItem = ListView_GetItemCount( hListView ); lv.iItem = ListView_GetItemCount( hListView );
ListView_InsertItem( hListView, &lv ); ListView_InsertItem( hListView, &lv );
ListView_SetItemText( hListView, lv.iItem, 0, ListView_SetItemText( hListView, lv.iItem, 0,
_FROMMB(debug.c_str()) ); (TCHAR *)_FROMMB(debug.c_str()) );
} }
vlc_mutex_lock( p_sub->p_lock ); vlc_mutex_lock( p_sub->p_lock );
......
This diff is collapsed.
...@@ -84,37 +84,37 @@ enum ...@@ -84,37 +84,37 @@ enum
// The TBBUTTON structure contains information the toolbar buttons. // The TBBUTTON structure contains information the toolbar buttons.
static TBBUTTON tbButton2[] = static TBBUTTON tbButton2[] =
{ {
{0, ID_MANAGE_OPENPL, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {0, ID_MANAGE_OPENPL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{1, ID_MANAGE_SAVEPL, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {1, ID_MANAGE_SAVEPL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{2, ID_MANAGE_SIMPLEADD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {2, ID_MANAGE_SIMPLEADD, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{3, ID_MANAGE_ADDMRL, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {3, ID_MANAGE_ADDMRL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{4, ID_SEL_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {4, ID_SEL_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{5, Infos_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {5, Infos_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{6, Up_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {6, Up_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{7, Down_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1}, {7, Down_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1}, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
{8, Random_Event, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, -1}, {8, Random_Event, TBSTATE_ENABLED, TBSTYLE_CHECK},
{9, Loop_Event, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, -1}, {9, Loop_Event, TBSTATE_ENABLED, TBSTYLE_CHECK},
{10, Repeat_Event, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, -1} {10, Repeat_Event, TBSTATE_ENABLED, TBSTYLE_CHECK}
}; };
// Toolbar ToolTips // Toolbar ToolTips
TCHAR * szToolTips2[] = TCHAR * szToolTips2[] =
{ {
HELP_OPENPL, HELP_OPENPL,
HELP_SAVEPL, HELP_SAVEPL,
HELP_SIMPLEADD, HELP_SIMPLEADD,
HELP_ADDMRL, HELP_ADDMRL,
HELP_DELETE, HELP_DELETE,
HELP_INFOS, HELP_INFOS,
HELP_UP, HELP_UP,
HELP_DOWN, HELP_DOWN,
HELP_RANDOM, HELP_RANDOM,
HELP_LOOP, HELP_LOOP,
HELP_REPEAT HELP_REPEAT
}; };
/***************************************************************************** /*****************************************************************************
...@@ -185,7 +185,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -185,7 +185,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
if( !SHCreateMenuBar(&mbi) ) if( !SHCreateMenuBar(&mbi) )
{ {
MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK); MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
//return -1; //return -1;
} }
...@@ -201,7 +201,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -201,7 +201,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS |
WS_EX_OVERLAPPEDWINDOW | CCS_NOPARENTALIGN; WS_EX_OVERLAPPEDWINDOW | CCS_NOPARENTALIGN;
hwndTB = CreateToolbarEx( hwnd, dwStyle, NULL, NUMIMAGES, hwndTB = CreateToolbarEx( hwnd, dwStyle, 0, NUMIMAGES,
hInst, IDB_BITMAP3, tbButton2, hInst, IDB_BITMAP3, tbButton2,
sizeof (tbButton2) / sizeof (TBBUTTON), sizeof (tbButton2) / sizeof (TBBUTTON),
BUTTONWIDTH, BUTTONHEIGHT, BUTTONWIDTH, BUTTONHEIGHT,
...@@ -684,44 +684,41 @@ void Playlist::OnSave() ...@@ -684,44 +684,41 @@ void Playlist::OnSave()
{ {
TCHAR szFile[NMAXFILE] = _T("\0"); TCHAR szFile[NMAXFILE] = _T("\0");
OPENFILENAME ofn; OPENFILENAME ofn;
TCHAR psz_filters[1000];
LPWSTR wUnicode; struct
int len; {
char *psz_desc;
struct { char *psz_filter;
TCHAR *psz_desc;
TCHAR *psz_filter;
char *psz_module; char *psz_module;
} formats[] = {{ _T("M3U file"), _T("*.m3u"), "export-m3u" },
{ _T("PLS file"), _T("*.pls"), "export-pls" }};
wUnicode = new TCHAR[100];
wcscpy( wUnicode, _T("") );
len = 0;
for( unsigned int i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) } formats[] =
{ { "M3U file", "*.m3u", "export-m3u" },
{ "PLS file", "*.pls", "export-pls" }
};
for( int i_len = 0, i = 0; i < sizeof(formats)/sizeof(formats[0]); i++ )
{ {
wcscpy( &wUnicode[len], formats[i].psz_desc ); _tcscpy( psz_filters + i_len, _FROMMB(formats[i].psz_desc) );
len = len + wcslen( formats[i].psz_desc ); i_len = i_len + _tcslen( psz_filters + i_len );
wUnicode[len] = '\0'; psz_filters[i_len++] = '\0';
len++; _tcscpy( psz_filters + i_len, _FROMMB(formats[i].psz_filter) );
wcscpy( &wUnicode[len], formats[i].psz_filter ); i_len = i_len + _tcslen( psz_filters + i_len );
len = len + wcslen( formats[i].psz_filter ); psz_filters[i_len++] = '\0';
wUnicode[len] = '\0'; if( i == sizeof(formats)/sizeof(formats[0]) -1 )
len++; psz_filters[i_len] = '\0';
} }
wUnicode[len] = '\0';
memset( &(ofn), 0, sizeof(ofn)); memset( &(ofn), 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn); ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL; ofn.hwndOwner = NULL;
ofn.lpstrFile = szFile; ofn.lpstrFile = szFile;
ofn.nMaxFile = NMAXFILE; ofn.nMaxFile = NMAXFILE;
ofn.lpstrFilter = wUnicode; ofn.lpstrFilter = psz_filters;
ofn.lpstrTitle = _T("Save playlist"); ofn.lpstrTitle = _T("Save playlist");
ofn.Flags = OFN_HIDEREADONLY; ofn.Flags = OFN_HIDEREADONLY;
free( wUnicode );
if( GetSaveFileName((LPOPENFILENAME) &ofn) ) if( GetSaveFileName( (LPOPENFILENAME)&ofn ) )
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
...@@ -762,7 +759,7 @@ void Playlist::OnAddFile() ...@@ -762,7 +759,7 @@ void Playlist::OnAddFile()
ofn.nMaxFileTitle = 40; ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL; ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Quick Open File"); ofn.lpstrTitle = _T("Quick Open File");
ofn.Flags = NULL; ofn.Flags = 0;
ofn.nFileOffset = 0; ofn.nFileOffset = 0;
ofn.nFileExtension = 0; ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL; ofn.lpstrDefExt = NULL;
......
...@@ -69,7 +69,8 @@ class PrefsTreeCtrl ...@@ -69,7 +69,8 @@ class PrefsTreeCtrl
public: public:
PrefsTreeCtrl() { } PrefsTreeCtrl() { }
PrefsTreeCtrl( intf_thread_t *_p_intf, PrefsDialog *p_prefs_dialog, HWND hwnd, HINSTANCE _hInst ); PrefsTreeCtrl( intf_thread_t *_p_intf, PrefsDialog *p_prefs_dialog,
HWND hwnd, HINSTANCE _hInst );
virtual ~PrefsTreeCtrl(); virtual ~PrefsTreeCtrl();
void ApplyChanges(); void ApplyChanges();
...@@ -157,10 +158,10 @@ FUNCTION: ...@@ -157,10 +158,10 @@ FUNCTION:
PURPOSE: PURPOSE:
Processes messages sent to the main window. Processes messages sent to the main window.
***********************************************************************/ ***********************************************************************/
LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
PBOOL pbProcessed ) PBOOL pbProcessed )
{ {
SHINITDLGINFO shidi; SHINITDLGINFO shidi;
SHMENUBARINFO mbi; SHMENUBARINFO mbi;
...@@ -172,7 +173,7 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -172,7 +173,7 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
switch( msg ) switch( msg )
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
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;
...@@ -186,11 +187,11 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -186,11 +187,11 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
mbi.nToolBarId = IDR_DUMMYMENU; mbi.nToolBarId = IDR_DUMMYMENU;
mbi.hInstRes = hInst; mbi.hInstRes = hInst;
mbi.nBmpId = 0; mbi.nBmpId = 0;
mbi.cBmpImages = 0; mbi.cBmpImages = 0;
if( !SHCreateMenuBar(&mbi) ) if( !SHCreateMenuBar(&mbi) )
{ {
MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK); MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
//return -1; //return -1;
} }
...@@ -199,7 +200,7 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, ...@@ -199,7 +200,7 @@ LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
// 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);
/* Create the buttons */ /* Create the buttons */
advanced_checkbox = advanced_checkbox =
CreateWindow( _T("BUTTON"), _T("Advanced options"), CreateWindow( _T("BUTTON"), _T("Advanced options"),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
...@@ -330,11 +331,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -330,11 +331,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
INITCOMMONCONTROLSEX iccex; INITCOMMONCONTROLSEX iccex;
RECT rcClient; RECT rcClient;
int size;
char *szAnsi;
LPWSTR wUnicode;
BOOL bTemp;
TVITEM tvi = {0}; TVITEM tvi = {0};
TVINSERTSTRUCT tvins = {0}; TVINSERTSTRUCT tvins = {0};
HTREEITEM hPrev; HTREEITEM hPrev;
...@@ -504,27 +500,19 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -504,27 +500,19 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
while( capability_item != 0 ) while( capability_item != 0 )
{ {
TVITEM capability_tvi = {0}; TVITEM capability_tvi = {0};
TCHAR psz_text[256];
i_child_index++; i_child_index++;
capability_tvi.mask = TVIF_TEXT; capability_tvi.mask = TVIF_TEXT;
capability_tvi.pszText = new WCHAR[200]; capability_tvi.pszText = psz_text;
capability_tvi.cchTextMax = 200; capability_tvi.cchTextMax = 256;
capability_tvi.hItem = capability_item; capability_tvi.hItem = capability_item;
TreeView_GetItem( hwndTV, &capability_tvi ); TreeView_GetItem( hwndTV, &capability_tvi );
size = WideCharToMultiByte( CP_ACP, 0, capability_tvi.pszText, -1, NULL, 0, NULL, &bTemp ); if( !strcmp( _TOMB(capability_tvi.pszText),
szAnsi = new char[size]; p_module->psz_capability ) ) break;
WideCharToMultiByte( CP_ACP, 0, capability_tvi.pszText, -1, szAnsi, size, NULL, &bTemp );
if( !strcmp( szAnsi, p_module->psz_capability ) ) capability_item =
{ TreeView_GetNextSibling( hwndTV, capability_item );
free( szAnsi );
free( capability_tvi.pszText );
break;
}
free( szAnsi );
free( capability_tvi.pszText );
capability_item = TreeView_GetNextSibling( hwndTV, capability_item );
} }
if( i_child_index == i_capability_count && if( i_child_index == i_capability_count &&
...@@ -565,7 +553,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -565,7 +553,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
tvins.hParent = capability_item;// level 4 tvins.hParent = capability_item;// level 4
// Add the item to the tree-view control. // Add the item to the tree-view control.
TreeView_InsertItem( hwndTV, &tvins); TreeView_InsertItem( hwndTV, &tvins );
} }
/* Sort all this mess */ /* Sort all this mess */
......
...@@ -112,9 +112,8 @@ ConfigControl *CreateConfigControl( vlc_object_t *p_this, ...@@ -112,9 +112,8 @@ ConfigControl *CreateConfigControl( vlc_object_t *p_this,
ConfigControl::ConfigControl( vlc_object_t *_p_this, ConfigControl::ConfigControl( vlc_object_t *_p_this,
module_config_t *p_item, module_config_t *p_item,
HWND parent, HINSTANCE hInst ) HWND parent, HINSTANCE hInst )
: parent( parent ), p_this( _p_this ), : p_this( _p_this ), pf_update_callback( NULL ), p_update_data( NULL ),
pf_update_callback( NULL ), p_update_data( NULL ), parent( parent ), name( p_item->psz_name ), i_type( p_item->i_type ),
name( p_item->psz_name ), i_type( p_item->i_type ),
b_advanced( p_item->b_advanced ) b_advanced( p_item->b_advanced )
{ {
......
...@@ -26,8 +26,7 @@ class ConfigControl ...@@ -26,8 +26,7 @@ class ConfigControl
{ {
public: public:
ConfigControl( vlc_object_t *, module_config_t *, HWND, HINSTANCE ); ConfigControl( vlc_object_t *, module_config_t *, HWND, HINSTANCE );
~ConfigControl(); virtual ~ConfigControl();
/*wxSizer *Sizer();*/
virtual int GetIntValue() {return 0;} virtual int GetIntValue() {return 0;}
virtual float GetFloatValue() {return 0;} virtual float GetFloatValue() {return 0;}
......
This diff is collapsed.
...@@ -88,10 +88,8 @@ Timer::~Timer() ...@@ -88,10 +88,8 @@ Timer::~Timer()
*****************************************************************************/ *****************************************************************************/
void Timer::Notify( void ) void Timer::Notify( void )
{ {
int size;
vlc_value_t val; vlc_value_t val;
char *shortname; char *shortname;
LPWSTR wUnicode;
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
...@@ -105,25 +103,18 @@ void Timer::Notify( void ) ...@@ -105,25 +103,18 @@ void Timer::Notify( void )
/* Show slider */ /* Show slider */
if( p_intf->p_sys->p_input ) if( p_intf->p_sys->p_input )
{ {
ShowWindow( p_main_interface->hwndSlider, SW_SHOW); ShowWindow( p_main_interface->hwndSlider, SW_SHOW );
ShowWindow( p_main_interface->hwndLabel, SW_SHOW); ShowWindow( p_main_interface->hwndLabel, SW_SHOW );
ShowWindow( p_main_interface->hwndVol, SW_SHOW); ShowWindow( p_main_interface->hwndVol, SW_SHOW );
// only for local file, check if works well with net url // only for local file, check if works well with net url
shortname = strrchr( p_intf->p_sys->p_input->input.p_item->psz_name, '\\' ); shortname = strrchr( p_intf->p_sys->p_input->input.p_item->psz_name, '\\' );
if (! shortname) if (! shortname)
shortname = p_intf->p_sys->p_input->input.p_item->psz_name; shortname = p_intf->p_sys->p_input->input.p_item->psz_name;
else else shortname++;
shortname++;
size = MultiByteToWideChar (CP_ACP, 0, shortname, -1, NULL, 0);
wUnicode = new WCHAR[size+1];
MultiByteToWideChar (CP_ACP, 0, shortname, -1, wUnicode + 1, size) ;
wUnicode[0] = L'\t';
SendMessage( p_main_interface->hwndSB, SB_SETTEXT, SendMessage( p_main_interface->hwndSB, SB_SETTEXT,
(WPARAM) 0, (LPARAM)(LPCTSTR) wUnicode); (WPARAM) 0, (LPARAM)_FROMMB(shortname) );
free( wUnicode );
p_main_interface->TogglePlayButton( PLAYING_S ); p_main_interface->TogglePlayButton( PLAYING_S );
i_old_playing_status = PLAYING_S; i_old_playing_status = PLAYING_S;
...@@ -179,20 +170,15 @@ void Timer::Notify( void ) ...@@ -179,20 +170,15 @@ void Timer::Notify( void )
p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_pos =
(int)(SLIDER_MAX_POS * pos.f_float); (int)(SLIDER_MAX_POS * pos.f_float);
SendMessage( p_main_interface->hwndSlider,TBM_SETPOS, SendMessage( p_main_interface->hwndSlider, TBM_SETPOS,
1, p_intf->p_sys->i_slider_pos ); 1, p_intf->p_sys->i_slider_pos );
var_Get( p_intf->p_sys->p_input, "time", &time ); var_Get( p_intf->p_sys->p_input, "time", &time );
i_seconds = time.i_time / 1000000; i_seconds = time.i_time / 1000000;
secstotimestr ( psz_time, i_seconds ); secstotimestr ( psz_time, i_seconds );
size = MultiByteToWideChar (CP_ACP, 0, psz_time, -1, NULL, 0);
wUnicode = new WCHAR[size];
MultiByteToWideChar (CP_ACP, 0, psz_time, -1, wUnicode, size) ;
SendMessage( p_main_interface->hwndLabel, WM_SETTEXT, SendMessage( p_main_interface->hwndLabel, WM_SETTEXT,
(WPARAM) 1, (LPARAM)(LPCTSTR) wUnicode ); (WPARAM)1, (LPARAM)_FROMMB(psz_time) );
free( wUnicode );
} }
} }
} }
...@@ -216,15 +202,12 @@ void Timer::Notify( void ) ...@@ -216,15 +202,12 @@ void Timer::Notify( void )
var_Get( p_input, "rate", &val ); var_Get( p_input, "rate", &val );
if( i_old_rate != val.i_int ) if( i_old_rate != val.i_int )
{ {
wUnicode = new WCHAR[10]; TCHAR psz_text[15];
swprintf( wUnicode + 2, TEXT("x%.2f"), 1000.0 / val.i_int ); _stprintf( psz_text + 2, _T("x%.2f"), 1000.0 / val.i_int );
wUnicode[0] = L'\t'; psz_text[0] = psz_text[1] = _T('\t');
wUnicode[1] = L'\t';
SendMessage( p_main_interface->hwndSB, SB_SETTEXT, SendMessage( p_main_interface->hwndSB, SB_SETTEXT,
(WPARAM) 1, (LPARAM)(LPCTSTR) wUnicode); (WPARAM) 1, (LPARAM)(LPCTSTR) psz_text );
free(wUnicode);
i_old_rate = val.i_int; i_old_rate = val.i_int;
} }
......
...@@ -228,38 +228,15 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args ) ...@@ -228,38 +228,15 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
switch( i_query ) switch( i_query )
{ {
case VOUT_SET_ZOOM: case VOUT_SET_ZOOM:
{
double f_arg = va_arg( args, double );
#if 0
/* Update dimensions */
wxSizeEvent event( wxSize((int)(p_vout->i_window_width * f_arg),
(int)(p_vout->i_window_height * f_arg)),
UpdateSize_Event );
AddPendingEvent( event );
#endif
i_ret = VLC_SUCCESS;
}
break; break;
case VOUT_SET_STAY_ON_TOP: case VOUT_SET_STAY_ON_TOP:
{
int i_arg = va_arg( args, int );
#if 0
wxCommandEvent event( wxEVT_VLC_VIDEO, SetStayOnTop_Event );
event.SetInt( i_arg );
AddPendingEvent( event );
#endif
i_ret = VLC_SUCCESS;
}
break; break;
default: default:
msg_Dbg( p_intf, "control query not supported" ); msg_Dbg( p_intf, "control query not supported" );
break; break;
} }
vlc_mutex_unlock( &lock ); vlc_mutex_unlock( &lock );
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#if defined( UNDER_CE ) && defined(__MINGW32__) #if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */ /* This is a gross hack for the wince gcc cross-compiler */
char *strerror( int );
# define _off_t long # define _off_t long
#endif #endif
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
vector<string> SeparateEntries( LPWSTR entries ); vector<string> SeparateEntries( TCHAR *entries );
class MenuItemExt; class MenuItemExt;
class VideoWindow; class VideoWindow;
...@@ -544,8 +543,8 @@ protected: ...@@ -544,8 +543,8 @@ protected:
return psz_wtomb; return psz_wtomb;
} }
#else #else
# define _FROMMB(a) # define _FROMMB(a) a
# define _TOMB(a) # define _TOMB(a) a
#endif #endif
#if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 ) #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
...@@ -606,6 +605,12 @@ extern "C" { ...@@ -606,6 +605,12 @@ extern "C" {
} NMRGINFO, *PNMRGINFO; } NMRGINFO, *PNMRGINFO;
} }
#if defined( WIN32 ) && !defined( UNDER_CE )
# define SHFullScreen(a,b)
# define SHInitDialog(a)
# define SHCreateMenuBar(a) 1
#endif
#endif //WINCE_RESOURCE #endif //WINCE_RESOURCE
#define IDD_ABOUT 101 #define IDD_ABOUT 101
......
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