Commit 206dd8c3 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince: bunch of fixes.

parent 1a12bcd9
......@@ -55,6 +55,7 @@ private:
void OnMessages( void );
void OnFileInfo( void );
void OnPreferences( void );
void OnPopupMenu( void );
void OnOpen( int, int );
void OnOpenFileSimple( int );
......@@ -137,6 +138,7 @@ LRESULT DialogsProvider::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
case WM_APP + INTF_DIALOG_MESSAGES: OnMessages(); return TRUE;
case WM_APP + INTF_DIALOG_FILEINFO: OnFileInfo(); return TRUE;
case WM_APP + INTF_DIALOG_PREFS: OnPreferences(); return TRUE;
case WM_APP + INTF_DIALOG_POPUPMENU: OnPopupMenu(); return TRUE;
}
return DefWindowProc( hwnd, msg, wp, lp );
......@@ -154,6 +156,12 @@ void DialogsProvider::OnIdle( void )
if( p_fileinfo_dialog ) p_fileinfo_dialog->UpdateFileInfo();
}
void DialogsProvider::OnPopupMenu( void )
{
POINT point = {0};
PopupMenu( p_intf, hWnd, point );
}
void DialogsProvider::OnPlaylist( void )
{
#if 1
......
......@@ -102,8 +102,10 @@ TCHAR * szToolTips[] =
/*****************************************************************************
* Constructor.
*****************************************************************************/
Interface::Interface()
: hwndMain(0), hwndCB(0), hwndTB(0), hwndSlider(0), hwndLabel(0),
Interface::Interface( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst )
: CBaseWindow( p_intf, p_parent, h_inst ),
hwndMain(0), hwndCB(0), hwndTB(0), hwndSlider(0), hwndLabel(0),
hwndVol(0), hwndSB(0), timer(0), video(0), b_volume_hold(0)
{
}
......@@ -114,14 +116,11 @@ Interface::~Interface()
if( video ) delete video;
}
BOOL Interface::InitInstance( HINSTANCE hInstance, intf_thread_t *_p_intf )
BOOL Interface::InitInstance()
{
/* Initializations */
p_intf = _p_intf;
i_old_playing_status = PAUSE_S;
hInst = hInstance; // Store instance handle in our global variable
int i_style = WS_VISIBLE;
#ifndef UNDER_CE
......@@ -132,7 +131,7 @@ BOOL Interface::InitInstance( HINSTANCE hInstance, intf_thread_t *_p_intf )
hwndMain =
CreateWindow( _T("VLC WinCE"), _T("VLC media player"), i_style,
0, MENU_HEIGHT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, (void *)this );
NULL, NULL, GetInstance(), (void *)this );
if( !hwndMain ) return FALSE;
......
......@@ -724,6 +724,7 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
MenuItemExt *p_menuitemext = NULL;
vector<MenuItemExt*>::iterator iter;
if( p_intf->p_sys->p_settings_menu )
for( iter = p_intf->p_sys->p_settings_menu->begin();
iter != p_intf->p_sys->p_settings_menu->end(); iter++ )
if( (*iter)->id == id )
......@@ -731,6 +732,8 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
p_menuitemext = *iter;
break;
}
if( p_intf->p_sys->p_audio_menu && !p_menuitemext )
for( iter = p_intf->p_sys->p_audio_menu->begin();
iter != p_intf->p_sys->p_audio_menu->end(); iter++ )
if( (*iter)->id == id )
......@@ -738,6 +741,8 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
p_menuitemext = *iter;
break;
}
if( p_intf->p_sys->p_video_menu && !p_menuitemext )
for( iter = p_intf->p_sys->p_video_menu->begin();
iter != p_intf->p_sys->p_video_menu->end(); iter++ )
if( (*iter)->id == id )
......@@ -745,6 +750,8 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
p_menuitemext = *iter;
break;
}
if( p_intf->p_sys->p_navig_menu && !p_menuitemext )
for( iter = p_intf->p_sys->p_navig_menu->begin();
iter != p_intf->p_sys->p_navig_menu->end(); iter++ )
if( (*iter)->id == id )
......
......@@ -238,9 +238,12 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
intf_thread_t *p_intf = (intf_thread_t *)param;
POINT point = {0};
PopupMenu( p_intf, p_intf->p_sys->p_main_window->hWnd, point );
if( p_intf->p_sys->pf_show_dialog )
{
p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_POPUPMENU,
new_val.b_bool, 0 );
}
return VLC_SUCCESS;
}
......@@ -207,9 +207,8 @@ static void Run( intf_thread_t *p_intf )
static void MainLoop( intf_thread_t *p_intf )
{
MSG msg;
Interface intf;
Interface *intf = 0;
p_intf->p_sys->p_main_window = &intf;
if( !hInstance ) hInstance = GetModuleHandle(NULL);
// Register window class
......@@ -234,17 +233,10 @@ static void MainLoop( intf_thread_t *p_intf )
if( !p_intf->pf_show_dialog )
{
/* The module is used in interface mode */
p_intf->p_sys->p_window = &intf;
p_intf->p_sys->p_window = intf = new Interface( p_intf, 0, hInstance );
/* Create/Show the interface */
if( !intf.InitInstance( hInstance, p_intf ) )
{
#ifndef UNDER_CE
/* Uninitialize OLE/COM */
CoUninitialize();
#endif
return;
}
if( !intf->InitInstance() ) goto end;
}
/* Creates the dialogs provider */
......@@ -277,6 +269,9 @@ static void MainLoop( intf_thread_t *p_intf )
DispatchMessage( &msg );
}
end:
if( intf ) delete intf;
#ifndef UNDER_CE
/* Uninitialize OLE/COM */
CoUninitialize();
......
......@@ -79,8 +79,6 @@ struct intf_sys_t
void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
intf_dialog_args_t *p_arg );
CBaseWindow *p_main_window;
/* Dynamic Menu management */
vector<MenuItemExt*> *p_audio_menu;
vector<MenuItemExt*> *p_video_menu;
......@@ -139,10 +137,10 @@ class Interface : public CBaseWindow
{
public:
/* Constructor */
Interface();
Interface( intf_thread_t *, CBaseWindow *, HINSTANCE );
~Interface();
BOOL InitInstance( HINSTANCE, intf_thread_t * );
BOOL InitInstance();
HWND CreateMenuBar( HWND, HINSTANCE );
void TogglePlayButton( int i_playing_status );
......
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