/*****************************************************************************
* dialogs.cpp : WinCE plugin for vlc
*****************************************************************************
- * Copyright (C) 2000-2005 VideoLAN
- * $Id: dialogs.cpp 10101 2005-03-02 16:47:31Z robux4 $
+ * Copyright (C) 2000-2005 the VideoLAN team
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
-#include <vlc/vlc.h>
-#include <vlc/aout.h>
-#include <vlc/intf.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_aout.h>
+#include <vlc_interface.h>
#include "wince.h"
void OnMessages( void );
void OnFileInfo( void );
void OnPreferences( void );
+ void OnPopupMenu( void );
void OnOpen( int, int );
void OnOpenFileSimple( int );
DialogsProvider::~DialogsProvider()
{
/* Clean up */
- if( p_open_dialog ) delete p_open_dialog;
- if( p_playlist_dialog ) delete p_playlist_dialog;
- if( p_messages_dialog ) delete p_messages_dialog;
- if( p_fileinfo_dialog ) delete p_fileinfo_dialog;
- if( p_prefs_dialog ) delete p_prefs_dialog;
+ delete p_open_dialog;
+ delete p_playlist_dialog;
+ delete p_messages_dialog;
+ delete p_fileinfo_dialog;
+ delete p_prefs_dialog;
if( h_gsgetfile_dll ) FreeLibrary( h_gsgetfile_dll );
}
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 );
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
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 1;
- ofn.lpstrFile = (LPTSTR)szFile;
+ ofn.lpstrFile = (LPTSTR)szFile;
ofn.nMaxFile = MAX_PATH;
- ofn.lpstrFileTitle = NULL;
+ ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _FROMMB(p_arg->psz_title);
- ofn.Flags = 0;
+ ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
}
free( p_arg->psz_results );
}
- if( p_arg->psz_title ) free( p_arg->psz_title );
- if( p_arg->psz_extensions ) free( p_arg->psz_extensions );
+ free( p_arg->psz_title );
+ free( p_arg->psz_extensions );
free( p_arg );
}
TCHAR szFile[MAX_PATH] = _T("\0");
static TCHAR szFilter[] = _T("All (*.*)\0*.*\0");
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
memset( &ofn, 0, sizeof(OPENFILENAME) );
ofn.lpstrFilter = szFilter;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
- ofn.nFilterIndex = 1;
- ofn.lpstrFile = (LPTSTR)szFile;
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFile = (LPTSTR)szFile;
ofn.nMaxFile = MAX_PATH;
- ofn.lpstrFileTitle = NULL;
+ ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Quick Open File");
- ofn.Flags = 0;
+ ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
PLAYLIST_APPEND | (i_arg?PLAYLIST_GO:0), PLAYLIST_END );
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void DialogsProvider::OnOpenDirectory( int i_arg )
HMODULE ceshell_dll = LoadLibrary( _T("ceshell") );
if( !ceshell_dll ) return;
- HRESULT WINAPI (*SHGetMalloc)(LPMALLOC *) =
- (HRESULT WINAPI (*)(LPMALLOC *))
+ HRESULT (WINAPI *SHGetMalloc)(LPMALLOC *) =
+ (HRESULT (WINAPI *)(LPMALLOC *))
GetProcAddress( ceshell_dll, _T("SHGetMalloc") );
- LPITEMIDLIST WINAPI (*SHBrowseForFolder)(LPBROWSEINFO) =
- (LPITEMIDLIST WINAPI (*)(LPBROWSEINFO))
+ LPITEMIDLIST (WINAPI *SHBrowseForFolder)(LPBROWSEINFO) =
+ (LPITEMIDLIST (WINAPI *)(LPBROWSEINFO))
GetProcAddress( ceshell_dll, _T("SHBrowseForFolder") );
- BOOL WINAPI (*SHGetPathFromIDList)(LPCITEMIDLIST, LPTSTR) =
- (BOOL WINAPI (*)(LPCITEMIDLIST, LPTSTR))
+ BOOL (WINAPI *SHGetPathFromIDList)(LPCITEMIDLIST, LPTSTR) =
+ (BOOL (WINAPI *)(LPCITEMIDLIST, LPTSTR))
GetProcAddress( ceshell_dll, _T("SHGetPathFromIDList") );
if( !SHGetMalloc || !SHBrowseForFolder || !SHGetPathFromIDList )
if( !SUCCEEDED( SHGetMalloc(&p_malloc) ) ) goto error;
- p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ p_playlist = pl_Yield( p_intf );
if( !p_playlist ) goto error;
memset( &bi, 0, sizeof(BROWSEINFO) );
error:
if( p_malloc) p_malloc->Release();
- if( p_playlist ) vlc_object_release( p_playlist );
+ if( p_playlist ) pl_Release( p_playlist );
#ifdef UNDER_CE
FreeLibrary( ceshell_dll );