Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
39c68369
Commit
39c68369
authored
Mar 30, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wince: added dialogs provider + another massive cleanup + updates.
parent
23584f31
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
949 additions
and
631 deletions
+949
-631
modules/gui/wince/Modules.am
modules/gui/wince/Modules.am
+1
-0
modules/gui/wince/dialogs.cpp
modules/gui/wince/dialogs.cpp
+430
-0
modules/gui/wince/fileinfo.cpp
modules/gui/wince/fileinfo.cpp
+15
-10
modules/gui/wince/interface.cpp
modules/gui/wince/interface.cpp
+32
-257
modules/gui/wince/iteminfo.cpp
modules/gui/wince/iteminfo.cpp
+8
-4
modules/gui/wince/messages.cpp
modules/gui/wince/messages.cpp
+49
-39
modules/gui/wince/open.cpp
modules/gui/wince/open.cpp
+60
-81
modules/gui/wince/playlist.cpp
modules/gui/wince/playlist.cpp
+73
-140
modules/gui/wince/preferences.cpp
modules/gui/wince/preferences.cpp
+7
-3
modules/gui/wince/subtitles.cpp
modules/gui/wince/subtitles.cpp
+30
-35
modules/gui/wince/video.cpp
modules/gui/wince/video.cpp
+0
-2
modules/gui/wince/wince.cpp
modules/gui/wince/wince.cpp
+174
-17
modules/gui/wince/wince.h
modules/gui/wince/wince.h
+70
-43
No files found.
modules/gui/wince/Modules.am
View file @
39c68369
...
@@ -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 \
...
...
modules/gui/wince/dialogs.cpp
0 → 100644
View file @
39c68369
/*****************************************************************************
* dialogs.cpp : WinCE plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2005 VideoLAN
* $Id: dialogs.cpp 10101 2005-03-02 16:47:31Z robux4 $
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h>
/* malloc(), free() */
#include <vlc/vlc.h>
#include <vlc/aout.h>
#include <vlc/intf.h>
#include "wince.h"
#include <commctrl.h>
#include <commdlg.h>
#include <shlobj.h>
/* Dialogs Provider */
class
DialogsProvider
:
public
CBaseWindow
{
public:
/* Constructor */
DialogsProvider
(
intf_thread_t
*
,
CBaseWindow
*
,
HINSTANCE
=
0
);
virtual
~
DialogsProvider
();
protected:
virtual
LRESULT
WndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
private:
void
OnExit
(
void
);
void
OnIdle
(
void
);
void
OnPlaylist
(
void
);
void
OnMessages
(
void
);
void
OnFileInfo
(
void
);
void
OnPreferences
(
void
);
void
OnOpen
(
int
,
int
);
void
OnOpenFileSimple
(
int
);
void
OnOpenDirectory
(
int
);
void
OnOpenFileGeneric
(
intf_dialog_args_t
*
);
/* GetOpenFileName replacement */
BOOL
(
WINAPI
*
GetOpenFile
)(
void
*
);
HMODULE
h_gsgetfile_dll
;
public:
/* Secondary windows */
OpenDialog
*
p_open_dialog
;
Playlist
*
p_playlist_dialog
;
Messages
*
p_messages_dialog
;
PrefsDialog
*
p_prefs_dialog
;
FileInfo
*
p_fileinfo_dialog
;
};
CBaseWindow
*
CreateDialogsProvider
(
intf_thread_t
*
p_intf
,
CBaseWindow
*
p_parent
,
HINSTANCE
h_inst
)
{
return
new
DialogsProvider
(
p_intf
,
p_parent
,
h_inst
);
}
/*****************************************************************************
* Constructor.
*****************************************************************************/
DialogsProvider
::
DialogsProvider
(
intf_thread_t
*
p_intf
,
CBaseWindow
*
p_parent
,
HINSTANCE
h_inst
)
:
CBaseWindow
(
p_intf
,
p_parent
,
h_inst
)
{
/* Initializations */
p_open_dialog
=
NULL
;
p_playlist_dialog
=
NULL
;
p_messages_dialog
=
NULL
;
p_fileinfo_dialog
=
NULL
;
p_prefs_dialog
=
NULL
;
/* Create dummy window */
hWnd
=
CreateWindow
(
_T
(
"VLC WinCE"
),
_T
(
"DialogsProvider"
),
0
,
0
,
0
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
p_parent
->
GetHandle
(),
NULL
,
h_inst
,
(
void
*
)
this
);
GetOpenFile
=
0
;
h_gsgetfile_dll
=
LoadLibrary
(
_T
(
"gsgetfile"
)
);
if
(
h_gsgetfile_dll
)
{
GetOpenFile
=
(
BOOL
(
WINAPI
*
)(
void
*
))
GetProcAddress
(
h_gsgetfile_dll
,
_T
(
"gsGetOpenFileName"
)
);
}
if
(
!
GetOpenFile
)
GetOpenFile
=
(
BOOL
(
WINAPI
*
)(
void
*
))
::
GetOpenFileName
;
}
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
;
if
(
h_gsgetfile_dll
)
FreeLibrary
(
h_gsgetfile_dll
);
}
LRESULT
DialogsProvider
::
WndProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
switch
(
msg
)
{
case
WM_APP
+
INTF_DIALOG_FILE
:
OnOpen
(
FILE_ACCESS
,
wp
);
return
TRUE
;
case
WM_APP
+
INTF_DIALOG_NET
:
OnOpen
(
NET_ACCESS
,
wp
);
return
TRUE
;
case
WM_APP
+
INTF_DIALOG_FILE_SIMPLE
:
OnOpenFileSimple
(
wp
);
return
TRUE
;
case
WM_APP
+
INTF_DIALOG_DIRECTORY
:
OnOpenDirectory
(
wp
);
return
TRUE
;
case
WM_APP
+
INTF_DIALOG_FILE_GENERIC
:
OnOpenFileGeneric
(
(
intf_dialog_args_t
*
)
lp
);
return
TRUE
;
case
WM_APP
+
INTF_DIALOG_PLAYLIST
:
OnPlaylist
();
return
TRUE
;
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
;
}
return
DefWindowProc
(
hwnd
,
msg
,
wp
,
lp
);
}
void
DialogsProvider
::
OnIdle
(
void
)
{
/* Update the log window */
if
(
p_messages_dialog
)
p_messages_dialog
->
UpdateLog
();
/* Update the playlist */
if
(
p_playlist_dialog
)
p_playlist_dialog
->
UpdatePlaylist
();
/* Update the fileinfo windows */
if
(
p_fileinfo_dialog
)
p_fileinfo_dialog
->
UpdateFileInfo
();
}
void
DialogsProvider
::
OnPlaylist
(
void
)
{
#if 1
Playlist
*
playlist
=
new
Playlist
(
p_intf
,
this
,
hInst
);
CreateDialogBox
(
hWnd
,
playlist
);
delete
playlist
;
#else
/* Show/hide the playlist window */
if
(
!
p_playlist_dialog
)
p_playlist_dialog
=
new
Playlist
(
p_intf
,
this
,
hInst
);
if
(
p_playlist_dialog
)
{
p_playlist_dialog
->
ShowPlaylist
(
!
p_playlist_dialog
->
IsShown
()
);
}
#endif
}
void
DialogsProvider
::
OnMessages
(
void
)
{
/* Show/hide the log window */
if
(
!
p_messages_dialog
)
p_messages_dialog
=
new
Messages
(
p_intf
,
this
,
hInst
);
if
(
p_messages_dialog
)
{
p_messages_dialog
->
Show
(
!
p_messages_dialog
->
IsShown
()
);
}
}
void
DialogsProvider
::
OnFileInfo
(
void
)
{
#if 1
FileInfo
*
fileinfo
=
new
FileInfo
(
p_intf
,
this
,
hInst
);
CreateDialogBox
(
hWnd
,
fileinfo
);
delete
fileinfo
;
#else
/* Show/hide the file info window */
if
(
!
p_fileinfo_dialog
)
p_fileinfo_dialog
=
new
FileInfo
(
p_intf
,
this
,
hInst
);
if
(
p_fileinfo_dialog
)
{
p_fileinfo_dialog
->
Show
(
!
p_fileinfo_dialog
->
IsShown
()
);
}
#endif
}
void
DialogsProvider
::
OnPreferences
(
void
)
{
#if 1
PrefsDialog
*
preferences
=
new
PrefsDialog
(
p_intf
,
this
,
hInst
);
CreateDialogBox
(
hWnd
,
preferences
);
delete
preferences
;
#else
/* Show/hide the open dialog */
if
(
!
p_prefs_dialog
)
p_prefs_dialog
=
new
PrefsDialog
(
p_intf
,
this
,
hInst
);
if
(
p_prefs_dialog
)
{
p_prefs_dialog
->
Show
(
!
p_prefs_dialog
->
IsShown
()
);
}
#endif
}
void
DialogsProvider
::
OnOpen
(
int
i_access
,
int
i_arg
)
{
/* Show/hide the open dialog */
if
(
!
p_open_dialog
)
p_open_dialog
=
new
OpenDialog
(
p_intf
,
this
,
hInst
,
i_access
,
i_arg
);
if
(
p_open_dialog
)
{
p_open_dialog
->
Show
(
!
p_open_dialog
->
IsShown
()
);
}
}
void
DialogsProvider
::
OnOpenFileGeneric
(
intf_dialog_args_t
*
p_arg
)
{
if
(
p_arg
==
NULL
)
{
msg_Dbg
(
p_intf
,
"OnOpenFileGeneric() called with NULL arg"
);
return
;
}
/* Convert the filter string */
TCHAR
*
psz_filters
=
(
TCHAR
*
)
malloc
(
(
strlen
(
p_arg
->
psz_extensions
)
+
2
)
*
sizeof
(
TCHAR
)
);
_tcscpy
(
psz_filters
,
_FROMMB
(
p_arg
->
psz_extensions
)
);
int
i
;
for
(
i
=
0
;
psz_filters
[
i
];
i
++
)
{
if
(
psz_filters
[
i
]
==
'|'
)
psz_filters
[
i
]
=
0
;
}
psz_filters
[
++
i
]
=
0
;
OPENFILENAME
ofn
;
TCHAR
szFile
[
MAX_PATH
]
=
_T
(
"
\0
"
);
memset
(
&
ofn
,
0
,
sizeof
(
OPENFILENAME
)
);
ofn
.
lStructSize
=
sizeof
(
OPENFILENAME
);
ofn
.
hwndOwner
=
hWnd
;
ofn
.
hInstance
=
hInst
;
ofn
.
lpstrFilter
=
psz_filters
;
ofn
.
lpstrCustomFilter
=
NULL
;
ofn
.
nMaxCustFilter
=
0
;
ofn
.
nFilterIndex
=
1
;
ofn
.
lpstrFile
=
(
LPTSTR
)
szFile
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
lpstrFileTitle
=
NULL
;
ofn
.
nMaxFileTitle
=
40
;
ofn
.
lpstrInitialDir
=
NULL
;
ofn
.
lpstrTitle
=
_FROMMB
(
p_arg
->
psz_title
);
ofn
.
Flags
=
0
;
ofn
.
nFileOffset
=
0
;
ofn
.
nFileExtension
=
0
;
ofn
.
lpstrDefExt
=
NULL
;
ofn
.
lCustData
=
0L
;
ofn
.
lpfnHook
=
NULL
;
ofn
.
lpTemplateName
=
NULL
;
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
if
(
p_arg
->
b_save
&&
GetSaveFileName
(
&
ofn
)
)
{
p_arg
->
i_results
=
1
;
p_arg
->
psz_results
=
(
char
**
)
malloc
(
p_arg
->
i_results
*
sizeof
(
char
*
)
);
p_arg
->
psz_results
[
0
]
=
strdup
(
_TOMB
(
ofn
.
lpstrFile
)
);
}
if
(
!
p_arg
->
b_save
&&
GetOpenFile
(
&
ofn
)
)
{
p_arg
->
i_results
=
1
;
p_arg
->
psz_results
=
(
char
**
)
malloc
(
p_arg
->
i_results
*
sizeof
(
char
*
)
);
p_arg
->
psz_results
[
0
]
=
strdup
(
_TOMB
(
ofn
.
lpstrFile
)
);
}
/* Callback */
if
(
p_arg
->
pf_callback
)
{
p_arg
->
pf_callback
(
p_arg
);
}
if
(
p_arg
->
psz_results
)
{
for
(
int
i
=
0
;
i
<
p_arg
->
i_results
;
i
++
)
{
free
(
p_arg
->
psz_results
[
i
]
);
}
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
);
}
void
DialogsProvider
::
OnOpenFileSimple
(
int
i_arg
)
{
OPENFILENAME
ofn
;
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
);
if
(
p_playlist
==
NULL
)
return
;
memset
(
&
ofn
,
0
,
sizeof
(
OPENFILENAME
)
);
ofn
.
lStructSize
=
sizeof
(
OPENFILENAME
);
ofn
.
hwndOwner
=
hWnd
;
ofn
.
hInstance
=
hInst
;
ofn
.
lpstrFilter
=
szFilter
;
ofn
.
lpstrCustomFilter
=
NULL
;
ofn
.
nMaxCustFilter
=
0
;
ofn
.
nFilterIndex
=
1
;
ofn
.
lpstrFile
=
(
LPTSTR
)
szFile
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
lpstrFileTitle
=
NULL
;
ofn
.
nMaxFileTitle
=
40
;
ofn
.
lpstrInitialDir
=
NULL
;
ofn
.
lpstrTitle
=
_T
(
"Quick Open File"
);
ofn
.
Flags
=
0
;
ofn
.
nFileOffset
=
0
;
ofn
.
nFileExtension
=
0
;
ofn
.
lpstrDefExt
=
NULL
;
ofn
.
lCustData
=
0L
;
ofn
.
lpfnHook
=
NULL
;
ofn
.
lpTemplateName
=
NULL
;
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
if
(
GetOpenFile
(
&
ofn
)
)
{
char
*
psz_filename
=
_TOMB
(
ofn
.
lpstrFile
);
playlist_Add
(
p_playlist
,
psz_filename
,
psz_filename
,
PLAYLIST_APPEND
|
(
i_arg
?
PLAYLIST_GO
:
0
),
PLAYLIST_END
);
}
vlc_object_release
(
p_playlist
);
}
void
DialogsProvider
::
OnOpenDirectory
(
int
i_arg
)
{
TCHAR
psz_result
[
MAX_PATH
];
LPMALLOC
p_malloc
=
0
;
LPITEMIDLIST
pidl
;
BROWSEINFO
bi
;
playlist_t
*
p_playlist
=
0
;
#ifdef UNDER_CE
# define SHGetMalloc MySHGetMalloc
# define SHBrowseForFolder MySHBrowseForFolder
# define SHGetPathFromIDList MySHGetPathFromIDList
HMODULE
ceshell_dll
=
LoadLibrary
(
_T
(
"ceshell"
)
);
if
(
!
ceshell_dll
)
return
;
HRESULT
WINAPI
(
*
SHGetMalloc
)(
LPMALLOC
*
)
=
(
HRESULT
WINAPI
(
*
)(
LPMALLOC
*
))
GetProcAddress
(
ceshell_dll
,
_T
(
"SHGetMalloc"
)
);
LPITEMIDLIST
WINAPI
(
*
SHBrowseForFolder
)(
LPBROWSEINFO
)
=
(
LPITEMIDLIST
WINAPI
(
*
)(
LPBROWSEINFO
))
GetProcAddress
(
ceshell_dll
,
_T
(
"SHBrowseForFolder"
)
);
BOOL
WINAPI
(
*
SHGetPathFromIDList
)(
LPCITEMIDLIST
,
LPTSTR
)
=
(
BOOL
WINAPI
(
*
)(
LPCITEMIDLIST
,
LPTSTR
))
GetProcAddress
(
ceshell_dll
,
_T
(
"SHGetPathFromIDList"
)
);
if
(
!
SHGetMalloc
||
!
SHBrowseForFolder
||
!
SHGetPathFromIDList
)
{
msg_Err
(
p_intf
,
"couldn't load SHBrowseForFolder API"
);
FreeLibrary
(
ceshell_dll
);
return
;
}
#endif
if
(
!
SUCCEEDED
(
SHGetMalloc
(
&
p_malloc
)
)
)
goto
error
;
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
goto
error
;
memset
(
&
bi
,
0
,
sizeof
(
BROWSEINFO
)
);
bi
.
hwndOwner
=
hWnd
;
bi
.
pszDisplayName
=
psz_result
;
bi
.
ulFlags
=
BIF_EDITBOX
;
#ifndef UNDER_CE
bi
.
ulFlags
|=
BIF_USENEWUI
;
#endif
if
(
(
pidl
=
SHBrowseForFolder
(
&
bi
)
)
)
{
if
(
SHGetPathFromIDList
(
pidl
,
psz_result
)
)
{
char
*
psz_filename
=
_TOMB
(
psz_result
);
playlist_Add
(
p_playlist
,
psz_filename
,
psz_filename
,
PLAYLIST_APPEND
|
(
i_arg
?
PLAYLIST_GO
:
0
),
PLAYLIST_END
);
}
p_malloc
->
Free
(
pidl
);
}
error:
if
(
p_malloc
)
p_malloc
->
Release
();
if
(
p_playlist
)
vlc_object_release
(
p_playlist
);
#ifdef UNDER_CE
FreeLibrary
(
ceshell_dll
);
#endif
}
modules/gui/wince/fileinfo.cpp
View file @
39c68369
...
@@ -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
(
hwnd
TV
,
&
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
(
hwnd
TV
,
&
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
(
hwnd
TV
,
&
tvins
);
}
}
TreeView_Expand
(
hwnd
,
hPrevLev2Item
,
TVE_EXPANDPARTIAL
|
TVE_EXPAND
);
TreeView_Expand
(
hwnd
TV
,
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
(
hwnd
TV
,
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
)
{
{
...
...
modules/gui/wince/interface.cpp
View file @
39c68369
...
@@ -33,12 +33,9 @@
...
@@ -33,12 +33,9 @@
#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>
#define NUMIMAGES 9 // Number of buttons in the toolbar
#define NUMIMAGES 9 // Number of buttons in the toolbar
#define IMAGEWIDTH 17 // Width of the buttons in the toolbar
#define IMAGEWIDTH 17 // Width of the buttons in the toolbar
...
@@ -107,9 +104,7 @@ TCHAR * szToolTips[] =
...
@@ -107,9 +104,7 @@ TCHAR * szToolTips[] =
*****************************************************************************/
*****************************************************************************/
Interface
::
Interface
()
Interface
::
Interface
()
:
hwndMain
(
0
),
hwndCB
(
0
),
hwndTB
(
0
),
hwndSlider
(
0
),
hwndLabel
(
0
),
:
hwndMain
(
0
),
hwndCB
(
0
),
hwndTB
(
0
),
hwndSlider
(
0
),
hwndLabel
(
0
),
hwndVol
(
0
),
hwndSB
(
0
),
hwndVol
(
0
),
hwndSB
(
0
),
timer
(
0
),
video
(
0
),
b_volume_hold
(
0
)
fileinfo
(
0
),
messages
(
0
),
preferences
(
0
),
playlist
(
0
),
timer
(
0
),
open
(
0
),
video
(
0
),
b_volume_hold
(
0
)
{
{
}
}
...
@@ -127,20 +122,6 @@ BOOL Interface::InitInstance( HINSTANCE hInstance, intf_thread_t *_p_intf )
...
@@ -127,20 +122,6 @@ BOOL Interface::InitInstance( HINSTANCE hInstance, intf_thread_t *_p_intf )
hInst
=
hInstance
;
// Store instance handle in our global variable
hInst
=
hInstance
;
// Store instance handle in our global variable
// Register window class
WNDCLASS
wc
;
wc
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wc
.
lpfnWndProc
=
(
WNDPROC
)
BaseWndProc
;
wc
.
cbClsExtra
=
0
;
wc
.
cbWndExtra
=
0
;
wc
.
hIcon
=
NULL
;
wc
.
hInstance
=
hInstance
;
wc
.
hCursor
=
NULL
;
wc
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
WHITE_BRUSH
);
wc
.
lpszMenuName
=
NULL
;
wc
.
lpszClassName
=
_T
(
"VLC WinCE"
);
if
(
!
RegisterClass
(
&
wc
)
)
return
FALSE
;
int
i_style
=
WS_VISIBLE
;
int
i_style
=
WS_VISIBLE
;
#ifndef UNDER_CE
#ifndef UNDER_CE
...
@@ -461,67 +442,6 @@ HWND CreateStatusBar( HWND hwnd, HINSTANCE hInst )
...
@@ -461,67 +442,6 @@ HWND CreateStatusBar( HWND hwnd, HINSTANCE hInst )
return
hwndSB
;
return
hwndSB
;
}
}
/***********************************************************************
FUNCTION:
CreateDialogBox
PURPOSE:
Creates a Dialog Box.
***********************************************************************/
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
);
}
/***********************************************************************
FUNCTION:
BaseWndProc
PURPOSE:
Processes messages sent to the main window.
***********************************************************************/
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
);
}
/***********************************************************************
/***********************************************************************
FUNCTION:
FUNCTION:
WndProc
WndProc
...
@@ -548,60 +468,28 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -548,60 +468,28 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
video
=
CreateVideoWindow
(
p_intf
,
hwnd
);
video
=
CreateVideoWindow
(
p_intf
,
hwnd
);
timer
=
new
Timer
(
p_intf
,
hwnd
,
this
);
timer
=
new
Timer
(
p_intf
,
hwnd
,
this
);
// Hide the SIP button (WINCE only)
SetForegroundWindow
(
hwnd
);
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
break
;
break
;
case
WM_COMMAND
:
case
WM_COMMAND
:
switch
(
GET_WM_COMMAND_ID
(
wp
,
lp
)
)
switch
(
GET_WM_COMMAND_ID
(
wp
,
lp
)
)
{
{
case
ID_FILE_QUICKOPEN
:
case
ID_FILE_QUICKOPEN
:
OnOpenFileSimple
();
break
;
case
ID_FILE_OPENFILE
:
case
ID_FILE_OPENFILE
:
open
=
new
OpenDialog
(
p_intf
,
hInst
,
FILE_ACCESS
,
ID_FILE_OPENFILE
,
OPEN_NORMAL
);
CreateDialogBox
(
hwnd
,
open
);
delete
open
;
break
;
case
ID_FILE_OPENDIR
:
case
ID_FILE_OPENDIR
:
OnOpenDirectory
();
break
;
case
ID_FILE_OPENNET
:
case
ID_FILE_OPENNET
:
open
=
new
OpenDialog
(
p_intf
,
hInst
,
NET_ACCESS
,
ID_FILE_OPENNET
,
case
ID_VIEW_STREAMINFO
:
OPEN_NORMAL
);
case
ID_VIEW_MESSAGES
:
CreateDialogBox
(
hwnd
,
open
);
case
ID_VIEW_PLAYLIST
:
delete
open
;
case
ID_PREFERENCES
:
break
;
OnShowDialog
(
GET_WM_COMMAND_ID
(
wp
,
lp
)
);
case
PlayStream_Event
:
OnPlayStream
();
break
;
case
StopStream_Event
:
OnStopStream
();
break
;
case
PrevStream_Event
:
OnPrevStream
();
break
;
case
NextStream_Event
:
OnNextStream
();
break
;
break
;
case
SlowStream_Event
:
case
PlayStream_Event
:
OnPlayStream
();
break
;
OnSlowStream
();
case
StopStream_Event
:
OnStopStream
();
break
;
break
;
case
PrevStream_Event
:
OnPrevStream
();
break
;
case
NextStream_Event
:
OnNextStream
();
break
;
case
FastStream_Event
:
case
SlowStream_Event
:
OnSlowStream
();
break
;
OnFastStream
();
case
FastStream_Event
:
OnFastStream
();
break
;
break
;
case
ID_FILE_ABOUT
:
case
ID_FILE_ABOUT
:
{
{
...
@@ -620,30 +508,6 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -620,30 +508,6 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
SendMessage
(
hwnd
,
WM_CLOSE
,
0
,
0
);
SendMessage
(
hwnd
,
WM_CLOSE
,
0
,
0
);
break
;
break
;
case
ID_VIEW_STREAMINFO
:
fileinfo
=
new
FileInfo
(
p_intf
,
hInst
);
CreateDialogBox
(
hwnd
,
fileinfo
);
delete
fileinfo
;
break
;
case
ID_VIEW_MESSAGES
:
messages
=
new
Messages
(
p_intf
,
hInst
);
CreateDialogBox
(
hwnd
,
messages
);
delete
messages
;
break
;
case
ID_VIEW_PLAYLIST
:
playlist
=
new
Playlist
(
p_intf
,
hInst
);
CreateDialogBox
(
hwnd
,
playlist
);
delete
playlist
;
break
;
case
ID_PREFERENCES
:
preferences
=
new
PrefsDialog
(
p_intf
,
hInst
);
CreateDialogBox
(
hwnd
,
preferences
);
delete
preferences
;
break
;
default:
default:
OnMenuEvent
(
p_intf
,
GET_WM_COMMAND_ID
(
wp
,
lp
)
);
OnMenuEvent
(
p_intf
,
GET_WM_COMMAND_ID
(
wp
,
lp
)
);
// we should test if it is a menu command
// we should test if it is a menu command
...
@@ -685,14 +549,17 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -685,14 +549,17 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
RefreshNavigMenu
(
p_intf
,
menu_navigation
);
RefreshNavigMenu
(
p_intf
,
menu_navigation
);
/* Fall through */
/* Fall through */
case
WM_ENTERMENULOOP
:
case
WM_KILLFOCUS
:
case
WM_KILLFOCUS
:
SHFullScreen
(
hwnd
,
SHFS_SHOWSIPBUTTON
);
case
WM_ENTERMENULOOP
:
if
(
video
&&
video
->
hWnd
)
if
(
video
&&
video
->
hWnd
)
SendMessage
(
video
->
hWnd
,
WM_KILLFOCUS
,
0
,
0
);
SendMessage
(
video
->
hWnd
,
WM_KILLFOCUS
,
0
,
0
);
break
;
break
;
case
WM_EXITMENULOOP
:
case
WM_SETFOCUS
:
case
WM_SETFOCUS
:
SHSipPreference
(
hwnd
,
SIP_DOWN
);
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
case
WM_EXITMENULOOP
:
if
(
video
&&
video
->
hWnd
)
if
(
video
&&
video
->
hWnd
)
SendMessage
(
video
->
hWnd
,
WM_SETFOCUS
,
0
,
0
);
SendMessage
(
video
->
hWnd
,
WM_SETFOCUS
,
0
,
0
);
break
;
break
;
...
@@ -737,117 +604,25 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -737,117 +604,25 @@ LRESULT Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
return
DefWindowProc
(
hwnd
,
msg
,
wp
,
lp
);
return
DefWindowProc
(
hwnd
,
msg
,
wp
,
lp
);
}
}
void
Interface
::
On
OpenFileSimple
(
void
)
void
Interface
::
On
ShowDialog
(
int
i_dialog_event
)
{
{
OPENFILENAME
ofn
;
int
i_id
;
TCHAR
DateiName
[
80
+
1
]
=
_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
);
if
(
p_playlist
==
NULL
)
return
;
memset
(
&
ofn
,
0
,
sizeof
(
OPENFILENAME
)
);
switch
(
i_dialog_event
)
ofn
.
lStructSize
=
sizeof
(
OPENFILENAME
);
ofn
.
hwndOwner
=
hwndMain
;
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
(
"Quick Open File"
);
ofn
.
Flags
=
0
;
ofn
.
nFileOffset
=
0
;
ofn
.
nFileExtension
=
0
;
ofn
.
lpstrDefExt
=
NULL
;
ofn
.
lCustData
=
0L
;
ofn
.
lpfnHook
=
NULL
;
ofn
.
lpTemplateName
=
NULL
;
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
if
(
GetOpenFile
(
&
ofn
)
)
{
{
char
*
psz_filename
=
_TOMB
(
ofn
.
lpstrFile
);
case
ID_FILE_QUICKOPEN
:
i_id
=
INTF_DIALOG_FILE_SIMPLE
;
break
;
playlist_Add
(
p_playlist
,
psz_filename
,
psz_filename
,
case
ID_FILE_OPENFILE
:
i_id
=
INTF_DIALOG_FILE
;
break
;
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
case
ID_FILE_OPENDIR
:
i_id
=
INTF_DIALOG_DIRECTORY
;
break
;
case
ID_FILE_OPENNET
:
i_id
=
INTF_DIALOG_NET
;
break
;
case
ID_VIEW_PLAYLIST
:
i_id
=
INTF_DIALOG_PLAYLIST
;
break
;
case
ID_VIEW_MESSAGES
:
i_id
=
INTF_DIALOG_MESSAGES
;
break
;
case
ID_VIEW_STREAMINFO
:
i_id
=
INTF_DIALOG_FILEINFO
;
break
;
case
ID_PREFERENCES
:
i_id
=
INTF_DIALOG_PREFS
;
break
;
default:
i_id
=
INTF_DIALOG_FILE
;
break
;
}
}
vlc_object_release
(
p_playlist
);
if
(
p_intf
->
p_sys
->
pf_show_dialog
)
}
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
i_id
,
1
,
0
);
void
Interface
::
OnOpenDirectory
(
void
)
{
TCHAR
psz_result
[
MAX_PATH
];
LPMALLOC
p_malloc
=
0
;
LPITEMIDLIST
pidl
;
BROWSEINFO
bi
;
playlist_t
*
p_playlist
=
0
;
#ifdef UNDER_CE
# define SHGetMalloc MySHGetMalloc
# define SHBrowseForFolder MySHBrowseForFolder
# define SHGetPathFromIDList MySHGetPathFromIDList
HMODULE
ceshell_dll
=
LoadLibrary
(
_T
(
"ceshell"
)
);
if
(
!
ceshell_dll
)
return
;
HRESULT
WINAPI
(
*
SHGetMalloc
)(
LPMALLOC
*
)
=
(
HRESULT
WINAPI
(
*
)(
LPMALLOC
*
))
GetProcAddress
(
ceshell_dll
,
_T
(
"SHGetMalloc"
)
);
LPITEMIDLIST
WINAPI
(
*
SHBrowseForFolder
)(
LPBROWSEINFO
)
=
(
LPITEMIDLIST
WINAPI
(
*
)(
LPBROWSEINFO
))
GetProcAddress
(
ceshell_dll
,
_T
(
"SHBrowseForFolder"
)
);
BOOL
WINAPI
(
*
SHGetPathFromIDList
)(
LPCITEMIDLIST
,
LPTSTR
)
=
(
BOOL
WINAPI
(
*
)(
LPCITEMIDLIST
,
LPTSTR
))
GetProcAddress
(
ceshell_dll
,
_T
(
"SHGetPathFromIDList"
)
);
if
(
!
SHGetMalloc
||
!
SHBrowseForFolder
||
!
SHGetPathFromIDList
)
{
msg_Err
(
p_intf
,
"couldn't load SHBrowseForFolder API"
);
FreeLibrary
(
ceshell_dll
);
return
;
}
#endif
if
(
!
SUCCEEDED
(
SHGetMalloc
(
&
p_malloc
)
)
)
goto
error
;
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
goto
error
;
memset
(
&
bi
,
0
,
sizeof
(
BROWSEINFO
)
);
bi
.
hwndOwner
=
hwndMain
;
bi
.
pszDisplayName
=
psz_result
;
bi
.
ulFlags
=
BIF_EDITBOX
;
#ifndef UNDER_CE
bi
.
ulFlags
|=
BIF_USENEWUI
;
#endif
if
(
(
pidl
=
SHBrowseForFolder
(
&
bi
)
)
)
{
if
(
SHGetPathFromIDList
(
pidl
,
psz_result
)
)
{
char
*
psz_filename
=
_TOMB
(
psz_result
);
playlist_Add
(
p_playlist
,
psz_filename
,
psz_filename
,
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
}
p_malloc
->
Free
(
pidl
);
}
error:
if
(
p_malloc
)
p_malloc
->
Release
();
if
(
p_playlist
)
vlc_object_release
(
p_playlist
);
#ifdef UNDER_CE
FreeLibrary
(
ceshell_dll
);
#endif
}
}
void
Interface
::
OnPlayStream
(
void
)
void
Interface
::
OnPlayStream
(
void
)
...
@@ -894,7 +669,7 @@ void Interface::OnPlayStream( void )
...
@@ -894,7 +669,7 @@ void Interface::OnPlayStream( void )
{
{
/* If the playlist is empty, open a file requester instead */
/* If the playlist is empty, open a file requester instead */
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
On
OpenFileSimple
(
);
On
ShowDialog
(
ID_FILE_QUICKOPEN
);
}
}
}
}
...
...
modules/gui/wince/iteminfo.cpp
View file @
39c68369
...
@@ -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
_hI
nst
,
HINSTANCE
h_i
nst
,
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
)
{
{
...
...
modules/gui/wince/messages.cpp
View file @
39c68369
...
@@ -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_TEX
T
;
lv
.
mask
=
LVCF_
FM
T
;
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
;
...
...
modules/gui/wince/open.cpp
View file @
39c68369
...
@@ -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
();
...
...
modules/gui/wince/playlist.cpp
View file @
39c68369
...
@@ -36,10 +36,6 @@
...
@@ -36,10 +36,6 @@
#include <commctrl.h>
#include <commctrl.h>
#include <commdlg.h>
#include <commdlg.h>
#ifndef NMAXFILE
#define NMAXFILE 512 // at least 256
#endif
#ifndef TEXTMAXBUF
#ifndef TEXTMAXBUF
#define TEXTMAXBUF 512 // at least 500
#define TEXTMAXBUF 512 // at least 500
#endif
#endif
...
@@ -123,13 +119,12 @@ TCHAR * szToolTips2[] =
...
@@ -123,13 +119,12 @@ TCHAR * szToolTips2[] =
/*****************************************************************************
/*****************************************************************************
* Constructor.
* Constructor.
*****************************************************************************/
*****************************************************************************/
Playlist
::
Playlist
(
intf_thread_t
*
_p_intf
,
HINSTANCE
_hInst
)
Playlist
::
Playlist
(
intf_thread_t
*
p_intf
,
CBaseWindow
*
p_parent
,
HINSTANCE
h_inst
)
:
CBaseWindow
(
p_intf
,
p_parent
,
h_inst
)
{
{
/* Initializations */
/* Initializations */
p_intf
=
_p_intf
;
hListView
=
NULL
;
hInst
=
_hInst
;
hListView
=
NULL
;
i_title_sorted
=
1
;
i_title_sorted
=
1
;
i_author_sorted
=
1
;
i_author_sorted
=
1
;
...
@@ -336,8 +331,6 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -336,8 +331,6 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
ListView_InsertColumn
(
hListView
,
2
,
&
lv
);
ListView_InsertColumn
(
hListView
,
2
,
&
lv
);
SetTimer
(
hwnd
,
1
,
500
/*milliseconds*/
,
NULL
);
SetTimer
(
hwnd
,
1
,
500
/*milliseconds*/
,
NULL
);
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
break
;
break
;
case
WM_TIMER
:
case
WM_TIMER
:
...
@@ -348,6 +341,11 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -348,6 +341,11 @@ LRESULT Playlist::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
:
switch
(
LOWORD
(
wp
)
)
switch
(
LOWORD
(
wp
)
)
{
{
...
@@ -361,29 +359,23 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -361,29 +359,23 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
break
;
break
;
case
ID_MANAGE_SAVEPL
:
case
ID_MANAGE_SAVEPL
:
SHFullScreen
(
GetForegroundWindow
(),
SHFS_SHOWSIPBUTTON
);
OnSave
();
OnSave
();
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
break
;
break
;
case
ID_MANAGE_ADDFILE
:
case
ID_MANAGE_ADDFILE
:
SHFullScreen
(
GetForegroundWindow
(),
SHFS_SHOWSIPBUTTON
);
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_FILE_SIMPLE
,
OnAddFile
();
0
,
0
);
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
b_need_update
=
VLC_TRUE
;
b_need_update
=
VLC_TRUE
;
break
;
break
;
case
ID_MANAGE_ADDDIRECTORY
:
case
ID_MANAGE_ADDDIRECTORY
:
SHFullScreen
(
GetForegroundWindow
(),
SHFS_SHOWSIPBUTTON
);
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_DIRECTORY
,
OnAddFile
();
0
,
0
);
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
b_need_update
=
VLC_TRUE
;
b_need_update
=
VLC_TRUE
;
break
;
break
;
case
ID_MANAGE_ADDMRL
:
case
ID_MANAGE_ADDMRL
:
SHFullScreen
(
GetForegroundWindow
(),
SHFS_SHOWSIPBUTTON
);
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_FILE
,
0
,
0
);
OnAddMRL
();
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
b_need_update
=
VLC_TRUE
;
b_need_update
=
VLC_TRUE
;
break
;
break
;
...
@@ -393,9 +385,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -393,9 +385,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
break
;
break
;
case
Infos_Event
:
case
Infos_Event
:
SHFullScreen
(
GetForegroundWindow
(),
SHFS_SHOWSIPBUTTON
);
OnPopupInfo
(
hwnd
);
OnPopupInfo
(
hwnd
);
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
b_need_update
=
VLC_TRUE
;
b_need_update
=
VLC_TRUE
;
break
;
break
;
...
@@ -474,7 +464,6 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
...
@@ -474,7 +464,6 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
case
PopupInfo_Event
:
case
PopupInfo_Event
:
OnPopupInfo
(
hwnd
);
OnPopupInfo
(
hwnd
);
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
b_need_update
=
VLC_TRUE
;
b_need_update
=
VLC_TRUE
;
break
;
break
;
...
@@ -579,6 +568,15 @@ void Playlist::HandlePopupMenu( HWND hwnd, POINT point )
...
@@ -579,6 +568,15 @@ void Playlist::HandlePopupMenu( HWND hwnd, POINT point )
DestroyMenu
(
hMenuTrackPopup
);
DestroyMenu
(
hMenuTrackPopup
);
}
}
/**********************************************************************
* Show the playlist
**********************************************************************/
void
Playlist
::
ShowPlaylist
(
bool
b_show
)
{
if
(
b_show
)
Rebuild
();
Show
(
b_show
);
}
/**********************************************************************
/**********************************************************************
* Update the playlist
* Update the playlist
**********************************************************************/
**********************************************************************/
...
@@ -703,146 +701,81 @@ void Playlist::DeleteItem( int item )
...
@@ -703,146 +701,81 @@ void Playlist::DeleteItem( int item )
/**********************************************************************
/**********************************************************************
* I/O functions
* I/O functions
**********************************************************************/
**********************************************************************/
void
Playlist
::
OnOpen
(
)
static
void
OnOpenCB
(
intf_dialog_args_t
*
p_arg
)
{
{
OPENFILENAME
ofn
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_arg
->
p_arg
;
TCHAR
DateiName
[
80
+
1
]
=
_T
(
"
\0
"
);
static
TCHAR
szFilter
[]
=
_T
(
"All playlists (*.pls;*.m3u;*.asx;*.b4s|M3U files|*.m3u)
\0
*.pls;*.m3u;*.asx;*.b4s|M3U files|*.m3u
\0
"
);
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
return
;
memset
(
&
ofn
,
0
,
sizeof
(
OPENFILENAME
)
);
if
(
p_arg
->
i_results
&&
p_arg
->
psz_results
[
0
]
)
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 playlist"
);
ofn
.
Flags
=
0
;
ofn
.
nFileOffset
=
0
;
ofn
.
nFileExtension
=
0
;
ofn
.
lpstrDefExt
=
NULL
;
ofn
.
lCustData
=
0L
;
ofn
.
lpfnHook
=
NULL
;
ofn
.
lpTemplateName
=
NULL
;
if
(
GetOpenFileName
((
LPOPENFILENAME
)
&
ofn
)
)
{
{
playlist_
Import
(
p_playlist
,
_TOMB
(
ofn
.
lpstrFile
)
);
playlist_
t
*
p_playlist
=
(
playlist_t
*
)
}
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
vlc_object_release
(
p_playlist
);
if
(
p_playlist
)
{
playlist_Import
(
p_playlist
,
p_arg
->
psz_results
[
0
]
);
}
if
(
p_playlist
)
vlc_object_release
(
p_playlist
);
}
}
}
void
Playlist
::
On
Save
()
void
Playlist
::
On
Open
()
{
{
TCHAR
szFile
[
NMAXFILE
]
=
_T
(
"
\0
"
);
char
*
psz_filters
=
"All playlists|*.pls;*.m3u;*.asx;*.b4s|M3U files|*.m3u"
;
OPENFILENAME
ofn
;
TCHAR
psz_filters
[
1000
];
struct
intf_dialog_args_t
*
p_arg
=
{
(
intf_dialog_args_t
*
)
malloc
(
sizeof
(
intf_dialog_args_t
)
);
char
*
psz_desc
;
memset
(
p_arg
,
0
,
sizeof
(
intf_dialog_args_t
)
);
char
*
psz_filter
;
char
*
psz_module
;
}
formats
[]
=
p_arg
->
psz_title
=
strdup
(
"Open playlist"
);
{
{
"M3U file"
,
"*.m3u"
,
"export-m3u"
},
p_arg
->
psz_extensions
=
strdup
(
psz_filters
);
{
"PLS file"
,
"*.pls"
,
"export-pls"
}
p_arg
->
p_arg
=
p_intf
;
}
;
p_arg
->
pf_callback
=
OnOpenCB
;
for
(
int
i_len
=
0
,
i
=
0
;
i
<
sizeof
(
formats
)
/
sizeof
(
formats
[
0
]);
i
++
)
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_FILE_GENERIC
,
0
,
p_arg
);
{
}
_tcscpy
(
psz_filters
+
i_len
,
_FROMMB
(
formats
[
i
].
psz_desc
)
);
i_len
=
i_len
+
_tcslen
(
psz_filters
+
i_len
);
psz_filters
[
i_len
++
]
=
'\0'
;
_tcscpy
(
psz_filters
+
i_len
,
_FROMMB
(
formats
[
i
].
psz_filter
)
);
i_len
=
i_len
+
_tcslen
(
psz_filters
+
i_len
);
psz_filters
[
i_len
++
]
=
'\0'
;
if
(
i
==
sizeof
(
formats
)
/
sizeof
(
formats
[
0
])
-
1
)
psz_filters
[
i_len
]
=
'\0'
;
}
memset
(
&
(
ofn
),
0
,
sizeof
(
ofn
));
static
void
OnSaveCB
(
intf_dialog_args_t
*
p_arg
)
ofn
.
lStructSize
=
sizeof
(
ofn
);
{
ofn
.
hwndOwner
=
NULL
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_arg
->
p_arg
;
ofn
.
lpstrFile
=
szFile
;
ofn
.
nMaxFile
=
NMAXFILE
;
ofn
.
lpstrFilter
=
psz_filters
;
ofn
.
lpstrTitle
=
_T
(
"Save playlist"
);
ofn
.
Flags
=
OFN_HIDEREADONLY
;
if
(
GetSaveFileName
(
(
LPOPENFILENAME
)
&
ofn
)
)
if
(
p_arg
->
i_results
&&
p_arg
->
psz_results
[
0
]
)
{
{
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
);
if
(
p_playlist
&&
ofn
.
lpstrFile
)
if
(
p_playlist
)
{
{
playlist_Export
(
p_playlist
,
_TOMB
(
ofn
.
lpstrFile
),
char
*
psz_export
;
formats
[
ofn
.
nFilterIndex
?
char
*
psz_ext
=
strrchr
(
p_arg
->
psz_results
[
0
],
'.'
);
ofn
.
nFilterIndex
-
1
:
0
].
psz_module
);
if
(
psz_ext
&&
!
strcmp
(
psz_ext
,
".pls"
)
)
psz_export
=
"export-pls"
;
else
psz_export
=
"export-m3u"
;
playlist_Export
(
p_playlist
,
p_arg
->
psz_results
[
0
],
psz_export
);
}
}
if
(
p_playlist
)
vlc_object_release
(
p_playlist
);
if
(
p_playlist
)
vlc_object_release
(
p_playlist
);
}
}
}
}
void
Playlist
::
On
AddFil
e
()
void
Playlist
::
On
Sav
e
()
{
{
// Same code as in Interface
char
*
psz_filters
=
"M3U file|*.m3u|PLS file|*.pls"
;
OPENFILENAME
ofn
;
TCHAR
DateiName
[
80
+
1
]
=
_T
(
"
\0
"
);
static
TCHAR
szFilter
[]
=
_T
(
"All (*.*)
\0
*.*
\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
(
"Add File"
);
ofn
.
Flags
=
0
;
ofn
.
nFileOffset
=
0
;
ofn
.
nFileExtension
=
0
;
ofn
.
lpstrDefExt
=
NULL
;
ofn
.
lCustData
=
0L
;
ofn
.
lpfnHook
=
NULL
;
ofn
.
lpTemplateName
=
NULL
;
SHFullScreen
(
GetForegroundWindow
(),
SHFS_HIDESIPBUTTON
);
if
(
GetOpenFileName
(
(
LPOPENFILENAME
)
&
ofn
)
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
return
;
char
*
psz_filename
=
_TOMB
(
ofn
.
lpstrFile
);
intf_dialog_args_t
*
p_arg
=
playlist_Add
(
p_playlist
,
psz_filename
,
psz_filename
,
(
intf_dialog_args_t
*
)
malloc
(
sizeof
(
intf_dialog_args_t
)
);
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
memset
(
p_arg
,
0
,
sizeof
(
intf_dialog_args_t
)
);
vlc_object_release
(
p_playlist
);
}
}
void
Playlist
::
OnAddMRL
()
p_arg
->
psz_title
=
strdup
(
"Save playlist"
);
{
p_arg
->
psz_extensions
=
strdup
(
psz_filters
);
p_arg
->
b_save
=
VLC_TRUE
;
p_arg
->
p_arg
=
p_intf
;
p_arg
->
pf_callback
=
OnSaveCB
;
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_FILE_GENERIC
,
0
,
p_arg
);
}
}
/**********************************************************************
/**********************************************************************
...
@@ -947,7 +880,7 @@ void Playlist::ShowInfos( HWND hwnd, int i_item )
...
@@ -947,7 +880,7 @@ void Playlist::ShowInfos( HWND hwnd, int i_item )
if
(
p_item
)
if
(
p_item
)
{
{
ItemInfoDialog
*
iteminfo_dialog
=
ItemInfoDialog
*
iteminfo_dialog
=
new
ItemInfoDialog
(
p_intf
,
hInst
,
p_item
);
new
ItemInfoDialog
(
p_intf
,
this
,
hInst
,
p_item
);
CreateDialogBox
(
hwnd
,
iteminfo_dialog
);
CreateDialogBox
(
hwnd
,
iteminfo_dialog
);
UpdateItem
(
i_item
);
UpdateItem
(
i_item
);
delete
iteminfo_dialog
;
delete
iteminfo_dialog
;
...
...
modules/gui/wince/preferences.cpp
View file @
39c68369
...
@@ -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
)
{
{
...
...
modules/gui/wince/subtitles.cpp
View file @
39c68369
...
@@ -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
);
}
modules/gui/wince/video.cpp
View file @
39c68369
...
@@ -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
;
...
...
modules/gui/wince/wince.cpp
View file @
39c68369
...
@@ -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
);
}
}
modules/gui/wince/wince.h
View file @
39c68369
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment