Commit ba2736f4 authored by Pierre Ynard's avatar Pierre Ynard

Remove the WinCE GUI

It is unmaintained, broken, and hasn't even been building for the
last 6 months.
parent 85686977
...@@ -4390,26 +4390,6 @@ AS_IF([test "${enable_qt4}" != "no"], [ ...@@ -4390,26 +4390,6 @@ AS_IF([test "${enable_qt4}" != "no"], [
]) ])
AM_CONDITIONAL(ENABLE_QT4, [test "x$enable_qt4" != "xno"]) AM_CONDITIONAL(ENABLE_QT4, [test "x$enable_qt4" != "xno"])
dnl
dnl WinCE GUI module
dnl
AC_ARG_ENABLE(wince,
[ --enable-wince Windows CE interface (default enabled with MinGW)])
if test "${enable_wince}" != "no"; then
if test "${SYS}" = "mingwce"; then
VLC_ADD_PLUGIN([wince])
VLC_ADD_CXXFLAGS([wince],[])
VLC_ADD_LIBS([wince],[-lcommctrl -lcommdlg -laygshell])
dnl Gross hack
VLC_ADD_LIBS([wince],[\\\${top_builddir}modules/gui/wince/wince_rc.o])
elif test "${SYS}" = "mingw32"; then
VLC_ADD_CXXFLAGS([wince],[])
VLC_ADD_LIBS([wince],[-lcomctl32 -lcomdlg32 -lgdi32 -lole32])
dnl Gross hack
VLC_ADD_LIBS([wince],[\\\${top_builddir}modules/gui/wince/wince_rc.o])
fi
fi
dnl dnl
dnl Simple test for skins2 dependency dnl Simple test for skins2 dependency
dnl dnl
...@@ -5287,7 +5267,6 @@ AC_CONFIG_FILES([ ...@@ -5287,7 +5267,6 @@ AC_CONFIG_FILES([
modules/gui/qnx/Makefile modules/gui/qnx/Makefile
modules/gui/qt4/Makefile modules/gui/qt4/Makefile
modules/gui/skins2/Makefile modules/gui/skins2/Makefile
modules/gui/wince/Makefile
modules/meta_engine/Makefile modules/meta_engine/Makefile
modules/misc/Makefile modules/misc/Makefile
modules/misc/dummy/Makefile modules/misc/dummy/Makefile
......
DIST_SUBDIRS = beos macosx hildon minimal_macosx qnx qt4 skins2 wince DIST_SUBDIRS = beos macosx hildon minimal_macosx qnx qt4 skins2
SUBDIRS = SUBDIRS =
if HAVE_BEOS if HAVE_BEOS
...@@ -17,9 +17,6 @@ endif ...@@ -17,9 +17,6 @@ endif
if BUILD_SKINS if BUILD_SKINS
SUBDIRS += skins2 SUBDIRS += skins2
endif endif
if HAVE_WINCE
SUBDIRS += wince
endif
SOURCES_ncurses = ncurses.c SOURCES_ncurses = ncurses.c
SOURCES_fbosd = fbosd.c SOURCES_fbosd = fbosd.c
SUFFIXES += .rc
wince_rc.o: $(top_srcdir)/modules/gui/wince/wince_rc.rc
$(WINDRES) --include-dir $(top_srcdir)/modules/gui/wince/ -i $< -o $@
SOURCES_wince = \
wince.cpp \
wince.h \
interface.cpp \
dialogs.cpp \
menus.cpp \
open.cpp \
playlist.cpp \
fileinfo.cpp \
iteminfo.cpp \
messages.cpp \
preferences.cpp \
preferences_widgets.cpp \
preferences_widgets.h \
subtitles.cpp \
timer.cpp \
video.cpp \
$(NULL)
EXTRA_DIST += \
wince_rc.rc \
bitmaps/vlc16x16.ico \
bitmaps/toolbar1.bmp \
bitmaps/toolbar2.bmp \
bitmaps/toolbar3.bmp
BUILT_SOURCES += wince_rc.o
This diff is collapsed.
/*****************************************************************************
* fileinfo.cpp : WinCE gui plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 the VideoLAN team
* $Id$
*
* Authors: Marodon Cedric <cedric_marodon@yahoo.fr>
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_input.h>
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <commdlg.h>
/*****************************************************************************
* Constructor.
*****************************************************************************/
FileInfo::FileInfo( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst )
: CBaseWindow( p_intf, p_parent, h_inst )
{
/* Initializations */
hwnd_fileinfo = hwndTV = NULL;
}
/***********************************************************************
FUNCTION:
CreateTreeView
PURPOSE:
Registers the TreeView control class and creates a TreeView.
***********************************************************************/
BOOL FileInfo::CreateTreeView(HWND hwnd)
{
DWORD dwStyle;
RECT rect;
INITCOMMONCONTROLSEX iccex;
iccex.dwSize = sizeof( INITCOMMONCONTROLSEX );
iccex.dwICC = ICC_TREEVIEW_CLASSES;
// Registers Statusbar control classes from the common control dll
InitCommonControlsEx( &iccex );
// Get the coordinates of the parent window's client area
GetClientRect( hwnd, &rect );
// Assign the window styles for the tree view.
dwStyle = WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT |
TVS_HASBUTTONS;
// Create the tree-view control.
hwndTV = CreateWindowEx( 0, WC_TREEVIEW, NULL, dwStyle, 0, MENU_HEIGHT,
rect.right-rect.left,
rect.bottom-rect.top-MENU_HEIGHT,
hwnd, NULL, hInst, NULL );
// Be sure that the tree view actually was created.
if( !hwndTV ) return FALSE;
UpdateFileInfo();
return TRUE;
}
/***********************************************************************
FUNCTION:
UpdateFileInfo
PURPOSE:
Update the TreeView with file information.
***********************************************************************/
void FileInfo::UpdateFileInfo()
{
TVITEM tvi = {0};
TVINSERTSTRUCT tvins = {0};
HTREEITEM hPrev = (HTREEITEM)TVI_FIRST;
HTREEITEM hPrevRootItem = NULL;
HTREEITEM hPrevLev2Item = NULL;
p_intf->p_sys->p_input = (input_thread_t *)
vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
input_thread_t *p_input = p_intf->p_sys->p_input;
if( !p_input ) return;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
input_item_t * inp_item = input_GetItem(p_input);
tvi.pszText = _FROMMB( input_item_GetName( inp_item ) );
tvi.cchTextMax = _tcslen( tvi.pszText );
// Save the heading level in the item's application-defined data area
tvi.lParam = (LPARAM)1;
tvins.item = tvi;
//tvins.hInsertAfter = TVI_LAST;
tvins.hInsertAfter = hPrev;
tvins.hParent = TVI_ROOT;
// Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
hPrevRootItem = hPrev;
vlc_mutex_lock( &inp_item->lock );
for( int i = 0; i < inp_item->i_categories; i++ )
{
info_category_t *p_cat = inp_item->pp_categories[i];
// Set the text of the item.
tvi.pszText = _FROMMB( inp_item->psz_name );
tvi.cchTextMax = _tcslen( tvi.pszText );
// Save the heading level in the item's application-defined data area
tvi.lParam = (LPARAM)2; // level 2
tvins.item = tvi;
tvins.hInsertAfter = hPrev;
tvins.hParent = hPrevRootItem;
// Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
hPrevLev2Item = hPrev;
for( int j = 0; j < p_cat->i_infos; j++ )
{
info_t *p_info = p_cat->pp_infos[j];
// Set the text of the item.
string szAnsi = (string)p_info->psz_name;
szAnsi += ": ";
szAnsi += p_info->psz_value;
tvi.pszText = (TCHAR *)_FROMMB( szAnsi.c_str() );
tvi.cchTextMax = _tcslen( tvi.pszText );
tvi.lParam = (LPARAM)3; // level 3
tvins.item = tvi;
tvins.hInsertAfter = hPrev;
tvins.hParent = hPrevLev2Item;
// Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
}
TreeView_Expand( hwndTV, hPrevLev2Item, TVE_EXPANDPARTIAL|TVE_EXPAND );
}
vlc_mutex_unlock( &inp_item->lock );
TreeView_Expand( hwndTV, hPrevRootItem, TVE_EXPANDPARTIAL|TVE_EXPAND );
return;
}
/***********************************************************************
FUNCTION:
WndProc
PURPOSE:
Processes messages sent to the main window.
***********************************************************************/
LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
SHINITDLGINFO shidi;
switch( msg )
{
case WM_INITDIALOG:
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hwnd;
SHInitDialog( &shidi );
CreateTreeView( hwnd );
UpdateWindow( hwnd );
SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON );
break;
case WM_CLOSE:
EndDialog( hwnd, LOWORD( wp ) );
break;
case WM_SETFOCUS:
SHSipPreference( hwnd, SIP_DOWN );
SHFullScreen( hwnd, SHFS_HIDESIPBUTTON );
break;
case WM_COMMAND:
if ( LOWORD(wp) == IDOK )
{
EndDialog( hwnd, LOWORD( wp ) );
}
break;
default:
break;
}
return FALSE;
}
This diff is collapsed.
/*****************************************************************************
* iteminfo.cpp : WinCE gui plugin for VLC
*****************************************************************************
* Copyright (C) 2000-2004 the VideoLAN team
* $Id$
*
* Authors: Marodon Cedric <cedric_marodon@yahoo.fr>
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <commdlg.h>
/*****************************************************************************
* Event Table.
*****************************************************************************/
/*****************************************************************************
* Constructor.
*****************************************************************************/
ItemInfoDialog::ItemInfoDialog( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst,
playlist_item_t *_p_item )
: CBaseWindow( p_intf, p_parent, h_inst )
{
/* Initializations */
p_item = _p_item;
}
/***********************************************************************
FUNCTION:
WndProc
PURPOSE:
Processes messages sent to the main window.
***********************************************************************/
LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
SHINITDLGINFO shidi;
SHMENUBARINFO mbi;
INITCOMMONCONTROLSEX iccex;
RECT rcClient;
char *psz_uri;
switch( msg )
{
case WM_INITDIALOG:
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hwnd;
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
GetClientRect( hwnd, &rcClient );
/* URI Textbox */
uri_label = CreateWindow( _T("STATIC"), _T("URI:"),
WS_CHILD | WS_VISIBLE | SS_RIGHT,
0, 10, 60, 15, hwnd, NULL, hInst, NULL);
psz_uri = input_item_GetURI( p_item->p_input );
uri_text = CreateWindow( _T("EDIT"), _FROMMB(psz_uri),
WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
70, 10 - 3, rcClient.right - 70 - 10, 15 + 6, hwnd, 0, hInst, 0 );
free( psz_uri );
/* Name Textbox */
name_label = CreateWindow( _T("STATIC"), _T("Name:"),
WS_CHILD | WS_VISIBLE | SS_RIGHT ,
0, 10 + 15 + 10, 60, 15,
hwnd, NULL, hInst, NULL);
name_text = CreateWindow( _T("EDIT"),
_FROMMB(p_item->p_input->psz_name),
WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
70, 10 + 15 + 10 - 3, rcClient.right - 70 - 10, 15 + 6,
hwnd, NULL, hInst, NULL);
/* CheckBox */
checkbox_label = CreateWindow( _T("STATIC"), _T("Item Enabled:"),
WS_CHILD | WS_VISIBLE | SS_RIGHT ,
rcClient.right - 15 - 10 - 90 - 10, 10 + 4*( 15 + 10 ) + 5, 90, 15,
hwnd, NULL, hInst, NULL );
enabled_checkbox = CreateWindow( _T("BUTTON"), _T("Item Enabled"),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
rcClient.right - 15 - 10, 10 + 4*( 15 + 10 ) + 5, 15, 15,
hwnd, NULL, hInst, NULL );
SendMessage( enabled_checkbox, BM_SETCHECK,
(p_item->i_flags & PLAYLIST_DBL_FLAG) ?
BST_UNCHECKED : BST_CHECKED, 0 );
/* Treeview */
iccex.dwSize = sizeof( INITCOMMONCONTROLSEX );
iccex.dwICC = ICC_TREEVIEW_CLASSES;
InitCommonControlsEx( &iccex );
// Create the tree-view control.
info_tree = CreateWindowEx( 0, WC_TREEVIEW, NULL,
WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES |
TVS_LINESATROOT | TVS_HASBUTTONS,
0, rcClient.bottom/2, rcClient.right,
rcClient.bottom - rcClient.bottom/2 - MENU_HEIGHT + 2, // +2 to fix
hwnd, NULL, hInst, NULL );
UpdateInfo();
break;
case WM_CLOSE:
EndDialog( hwnd, LOWORD( wp ) );
break;
case WM_SETFOCUS:
SHSipPreference( hwnd, SIP_DOWN );
SHFullScreen( hwnd, SHFS_HIDESIPBUTTON );
break;
case WM_COMMAND:
if( LOWORD(wp) == IDOK )
{
OnOk();
EndDialog( hwnd, LOWORD( wp ) );
}
break;
default:
break;
}
return FALSE;
}
/*****************************************************************************
* Private methods.
*****************************************************************************/
void ItemInfoDialog::UpdateInfo()
{
TVITEM tvi = {0};
TVINSERTSTRUCT tvins = {0};
HTREEITEM hPrev = (HTREEITEM)TVI_FIRST;
HTREEITEM hPrevRootItem = NULL;
HTREEITEM hPrevLev2Item = NULL;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
// Set the text of the item.
tvi.pszText = _FROMMB(p_item->p_input->psz_name);
tvi.cchTextMax = _tcslen(tvi.pszText);
// Save the heading level in the item's application-defined data area
tvi.lParam = (LPARAM)1; // root level
tvins.item = tvi;
tvins.hInsertAfter = hPrev;
tvins.hParent = TVI_ROOT;
// Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( info_tree, &tvins );
hPrevRootItem = hPrev;
/* Rebuild the tree */
vlc_mutex_lock( &p_item->p_input->lock );
for( int i = 0; i < p_item->p_input->i_categories; i++ )
{
info_category_t *p_cat = p_item->p_input->pp_categories[i];
// Set the text of the item.
tvi.pszText = _FROMMB( p_item->p_input->psz_name );
tvi.cchTextMax = _tcslen( tvi.pszText );
// Save the heading level in the item's application-defined data area
tvi.lParam = (LPARAM)2; // level 2
tvins.item = tvi;
tvins.hInsertAfter = hPrev;
tvins.hParent = hPrevRootItem;
// Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( info_tree, &tvins );
hPrevLev2Item = hPrev;
for( int j = 0; j < p_cat->i_infos; j++ )
{
info_t *p_info = p_cat->pp_infos[j];
// Set the text of the item.
string szAnsi = (string)p_info->psz_name;
szAnsi += ": ";
szAnsi += p_info->psz_value;
tvi.pszText = (TCHAR *)_FROMMB( szAnsi.c_str() );
tvi.cchTextMax = _tcslen( tvi.pszText );
tvi.lParam = (LPARAM)3; // level 3
tvins.item = tvi;
tvins.hInsertAfter = hPrev;
tvins.hParent = hPrevLev2Item;
// Add the item to the tree-view control.
hPrev = (HTREEITEM)TreeView_InsertItem( info_tree, &tvins );
}
TreeView_Expand( info_tree, hPrevLev2Item,
TVE_EXPANDPARTIAL |TVE_EXPAND );
}
vlc_mutex_unlock( &p_item->p_input->lock );
TreeView_Expand( info_tree, hPrevRootItem, TVE_EXPANDPARTIAL |TVE_EXPAND );
}
/*****************************************************************************
* Events methods.
*****************************************************************************/
void ItemInfoDialog::OnOk()
{
int b_state = false;
TCHAR psz_name[MAX_PATH];
Edit_GetText( name_text, psz_name, MAX_PATH );
input_item_SetName( p_item->p_input, _TOMB( psz_name ) );
TCHAR psz_uri[MAX_PATH];
Edit_GetText( uri_text, psz_uri, MAX_PATH );
input_item_SetURI( p_item->p_input, _TOMB(psz_uri) );
vlc_mutex_lock( &p_item->p_input->lock );
bool b_old_enabled = !(p_item->i_flags & PLAYLIST_DBL_FLAG);
playlist_t * p_playlist = pl_Hold( p_intf );
if( p_playlist != NULL )
{
b_state = SendMessage( enabled_checkbox, BM_GETCHECK, 0, 0 );
pl_Release( p_intf );
}
p_item->i_flags |= (b_state & BST_CHECKED) ? false : PLAYLIST_DBL_FLAG ;
vlc_mutex_unlock( &p_item->p_input->lock );
}
This diff is collapsed.
/*****************************************************************************
* messages.cpp : WinCE gui plugin for VLC
*****************************************************************************
* Copyright (C) 2000-2004 the VideoLAN team
* $Id$
*
* Authors: Marodon Cedric <cedric_marodon@yahoo.fr>
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_interface.h>
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <commdlg.h>
#ifndef NMAXFILE
#define NMAXFILE 512 // at least 256
#endif
#ifndef TEXTMAXBUF
#define TEXTMAXBUF 512 // at least 500
#endif
/*****************************************************************************
* Constructor.
*****************************************************************************/
Messages::Messages( intf_thread_t *p_intf, CBaseWindow *p_parent,
HINSTANCE h_inst )
: CBaseWindow( p_intf, p_parent, h_inst )
{
/* Initializations */
hListView = NULL;
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 );
// Suscribe to messages bank
cb_data = new msg_cb_data_t;
cb_data->self = this;
sub = msg_Subscribe( p_intf->p_libvlc, sinkMessage, cb_data );
}
Messages::~Messages()
{
msg_Unsubscribe(sub);
delete cb_data;
}
/***********************************************************************
FUNCTION:
WndProc
PURPOSE:
Processes messages sent to the main window.
***********************************************************************/
LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
SHINITDLGINFO shidi;
TCHAR psz_text[TEXTMAXBUF];
OPENFILENAME ofn;
int i_dummy;
HANDLE fichier;
switch( msg )
{
case WM_CREATE:
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hwnd;
SHInitDialog( &shidi );
hListView = CreateWindow( WC_LISTVIEW, NULL,
WS_VISIBLE | WS_CHILD | LVS_REPORT |
LVS_SHOWSELALWAYS | WS_VSCROLL | WS_HSCROLL |
WS_BORDER | LVS_NOCOLUMNHEADER, 0, 0, 0, 0,
hwnd, NULL, hInst, NULL );
ListView_SetExtendedListViewStyle( hListView, LVS_EX_FULLROWSELECT );
LVCOLUMN lv;
lv.mask = LVCF_FMT;
lv.fmt = LVCFMT_LEFT ;
ListView_InsertColumn( hListView, 0, &lv );
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;
case WM_SETFOCUS:
SHSipPreference( hwnd, SIP_DOWN );
SHFullScreen( hwnd, SHFS_HIDESIPBUTTON );
break;
case WM_CLOSE:
Show( FALSE );
return TRUE;
case WM_COMMAND:
switch( LOWORD(wp) )
{
case IDOK:
Show( FALSE );
break;
case IDCLEAR:
ListView_DeleteAllItems( hListView );
break;
case IDSAVEAS:
memset( &(ofn), 0, sizeof(ofn) );
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = _T("");
ofn.nMaxFile = NMAXFILE;
ofn.lpstrFilter = _T("Text (*.txt)\0*.txt\0");
ofn.lpstrTitle = _T("Save File As");
ofn.Flags = OFN_HIDEREADONLY;
ofn.lpstrDefExt = _T("txt");
if( GetSaveFileName( (LPOPENFILENAME)&ofn ) )
{
fichier = CreateFile( ofn.lpstrFile, GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL );
if( fichier != INVALID_HANDLE_VALUE )
{
int n;
//SetFilePointer( fichier, 0, NULL, FILE_END );
for( n = 0; n < ListView_GetItemCount( hListView ); n++ )
{
ListView_GetItemText( hListView, n, 0, psz_text,
TEXTMAXBUF );
string text_out = (string)_TOMB(psz_text) + "\n";
WriteFile( fichier, text_out.c_str(), text_out.size(),
(LPDWORD)&i_dummy, NULL );
}
FlushFileBuffers( fichier );
CloseHandle(fichier);
}
}
break;
default:
break;
}
default:
break;
}
return DefWindowProc( hwnd, msg, wp, lp );
}
void Messages::sinkMessage (msg_cb_data_t *data, msg_item_t *item,
unsigned overruns)
{
Messages *self = data->self;
self->sinkMessage (item, overruns);
}
void Messages::sinkMessage (msg_item_t *item, unsigned overruns)
{
vlc_value_t val;
var_Get( p_intf->p_libvlc, "verbose", &val );
/* Append all messages to log window */
string debug = item->psz_module;
switch( item->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 */
debug += item->psz_msg;
LVITEM lv;
lv.mask = LVIF_TEXT;
lv.pszText = TEXT("");
lv.cchTextMax = 1;
lv.iSubItem = 0;
lv.iItem = ListView_GetItemCount( hListView );
ListView_InsertItem( hListView, &lv );
ListView_SetItemText( hListView, lv.iItem, 0,
(TCHAR *)_FROMMB(debug.c_str()) );
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment