Commit 89031d0f authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince: WinCE build fixes.

parent 55a23c4d
......@@ -25,24 +25,20 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <aygshell.h>
#include <commdlg.h>
#include "wince.h"
/*****************************************************************************
* Constructor.
*****************************************************************************/
......
......@@ -31,20 +31,14 @@
#include <vlc/vout.h>
#include <vlc/intf.h>
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <aygshell.h>
#include <commdlg.h> // common dialogs -> fileopen.lib ?
#include "wince.h"
#define NUMIMAGES 9 // Number of buttons in the toolbar
#define IMAGEWIDTH 17 // Width of the buttons in the toolbar
#define IMAGEHEIGHT 16 // Height of the buttons in the toolbar
......@@ -451,7 +445,7 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK);
//return -1;
}
hwndCB = mbi.hwndMB;
// Creates the toolbar
......@@ -470,7 +464,8 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
hwndSB = CreateStatusbar( hwnd );
/* Video window */
video = CreateVideoWindow( pIntf, hInst, hwnd );
if( config_GetInt( pIntf, "wince-embed" ) )
video = CreateVideoWindow( pIntf, hInst, hwnd );
ti = new Timer(pIntf, hwnd, this);
......@@ -611,7 +606,6 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
break;
case WM_INITMENUPOPUP:
msg_Err( pIntf, "WM_INITMENUPOPUP" );
RefreshSettingsMenu( pIntf,
(HMENU)SendMessage( hwndCB, SHCMBM_GETSUBMENU, (WPARAM)0,
(LPARAM)IDM_SETTINGS ) );
......@@ -625,7 +619,6 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
(HMENU)SendMessage( hwndCB, SHCMBM_GETSUBMENU, (WPARAM)0,
(LPARAM)IDM_NAVIGATION ) );
msg_Err( pIntf, "WM_MEND" );
#if 0
// Undo the video display because menu is opened
// due to GAPI, menu top display is not assumed
......
......@@ -25,25 +25,20 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <string.h>
#include <stdlib.h> /* malloc(), free() */
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <aygshell.h>
#include <commdlg.h>
#include "wince.h"
/*****************************************************************************
* Event Table.
*****************************************************************************/
......
......@@ -28,11 +28,6 @@
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <string>
#include <stdio.h>
using namespace std;
#include <vlc/vlc.h>
#include <vlc/intf.h>
......
......@@ -25,24 +25,20 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <aygshell.h>
#include <commdlg.h>
#include "wince.h"
#ifndef NMAXFILE
#define NMAXFILE 512 // at least 256
#endif
......
......@@ -25,25 +25,20 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <string.h>
#include <stdlib.h> /* malloc(), free() */
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <aygshell.h>
#include <commdlg.h>
#include "wince.h"
/*****************************************************************************
* Event Table.
*****************************************************************************/
......
......@@ -25,17 +25,17 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <commctrl.h>
#include <commdlg.h>
#include <newmenu.h>
#ifndef NMAXFILE
#define NMAXFILE 512 // at least 256
#endif
......@@ -46,10 +46,6 @@ using namespace std;
#define LONG2POINT(l, pt) ((pt).x = (SHORT)LOWORD(l), (pt).y = (SHORT)HIWORD(l))
#include "wince.h"
#include <aygshell.h>
#define NUMIMAGES 11 // Number of buttons in the toolbar
#define IMAGEWIDTH 16 // Width of the buttons in the toolbar
#define IMAGEHEIGHT 16 // Height of the buttons in the toolbar
......
......@@ -25,25 +25,22 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <aygshell.h>
#include <commdlg.h>
#include <vlc_config_cat.h>
#include "wince.h"
#include "preferences_widgets.h"
#define GENERAL_ID 1242
......
......@@ -28,19 +28,16 @@
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <string>
using namespace std;
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "wince.h"
#include <windows.h>
#include <windowsx.h>
#include <winuser.h>
#include <commctrl.h>
#include <aygshell.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "wince.h"
#include "preferences_widgets.h"
/*****************************************************************************
......
......@@ -25,25 +25,20 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <string.h>
#include <stdlib.h> /* malloc(), free() */
#include <string>
#include <stdio.h>
using namespace std;
#include "wince.h"
#include <winuser.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <aygshell.h>
#include <commdlg.h>
#include "wince.h"
/*****************************************************************************
* Event Table.
*****************************************************************************/
......
......@@ -28,19 +28,14 @@
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <string>
#include <stdio.h>
using namespace std;
#include <vlc/vlc.h>
#include <vlc/aout.h>
#include <vlc/intf.h>
#include <commctrl.h>
#include "wince.h"
#include <commctrl.h>
/* Callback prototype */
static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param );
......
......@@ -28,6 +28,14 @@
#include <vlc/vlc.h>
#include <vlc/intf.h>
#if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */
#undef strerror
#define _off_t long
char *strerror( int i_err ){ return "error message not available"; };
void abort (void){};
#endif
#include "wince.h"
/*****************************************************************************
......@@ -40,12 +48,19 @@ static void Run ( intf_thread_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define EMBED_TEXT N_("Embed video in interface")
#define EMBED_LONGTEXT N_("Embed the video inside the interface instead " \
"of having it in a separate window.")
vlc_module_begin();
set_description( (char *) _("WinCE interface module") );
set_capability( "interface", 200 );
set_callbacks( Open, Close );
add_shortcut( "wince" );
set_program( "wcevlc" );
add_bool( "wince-embed", 1, NULL,
EMBED_TEXT, EMBED_LONGTEXT, VLC_FALSE );
vlc_module_end();
HINSTANCE hInstance = 0;
......@@ -121,6 +136,8 @@ static void Run( intf_thread_t *p_intf )
MSG msg;
Interface *pInterface = new Interface();
if( !hInstance ) hInstance = GetModuleHandle(NULL);
if( !pInterface->InitInstance( hInstance, p_intf ) ) return;
// Main message loop
......
......@@ -24,10 +24,9 @@
#ifndef WINCE_RESOURCE
#define MENU_HEIGHT 26
#define SLIDER_HEIGHT 50
#define SLIDER_MAX_POS 10000
#define MENU_HEIGHT 26
#define FILE_ACCESS 1
#define NET_ACCESS 2
......@@ -35,6 +34,12 @@
#define OPEN_NORMAL 0
#define OPEN_STREAM 1
#if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */
char *strerror( int );
# define _off_t long
#endif
#include "vlc_keys.h"
#include <stdio.h>
......@@ -549,6 +554,58 @@ protected:
# define ISUTF8 0
#endif
/*****************************************************************************
* Misc definitions (mainly from aygshell.h)
*****************************************************************************/
#define _WIN32_IE 0x0500
#define SHFS_HIDESIPBUTTON 0x0008
#define SHIDIM_FLAGS 0x0001
#define SHIDIF_DONEBUTTON 0x0001
#define SHIDIF_SIPDOWN 0x0008
#define SHIDIF_FULLSCREENNOMENUBAR 0x0010
#define SHCMBF_HMENU 0x0010
#define SHFS_SHOWSIPBUTTON 0x0004
#define GN_CONTEXTMENU 1000
#define SHCMBM_GETSUBMENU (WM_USER + 401)
#define lstrlenW wcslen
#define TrackPopupMenu(hm,u,x,y,r,hw,p) \
TrackPopupMenuEx((hm),(u),(x),(y),(hw),0)
extern "C" {
typedef struct tagSHMENUBARINFO
{
DWORD cbSize;
HWND hwndParent;
DWORD dwFlags;
UINT nToolBarId;
HINSTANCE hInstRes;
int nBmpId;
int cBmpImages;
HWND hwndMB;
COLORREF clrBk;
} SHMENUBARINFO, *PSHMENUBARINFO;
BOOL SHCreateMenuBar( SHMENUBARINFO *pmbi );
BOOL SHFullScreen(HWND hwndRequester, DWORD dwState);
typedef struct tagSHINITDLGINFO
{
DWORD dwMask;
HWND hDlg;
DWORD dwFlags;
} SHINITDLGINFO, *PSHINITDLGINFO;
BOOL SHInitDialog(PSHINITDLGINFO pshidi);
typedef struct tagNMRGINFO
{
NMHDR hdr;
POINT ptAction;
DWORD dwItemSpec;
} NMRGINFO, *PNMRGINFO;
}
#endif //WINCE_RESOURCE
#define IDD_ABOUT 101
......
......@@ -8,37 +8,17 @@
#endif
#if defined(_WIN32_WCE)
#if !defined(WCEOLE_ENABLE_DIALOGEX)
#define DIALOGEX DIALOG DISCARDABLE
#endif
#include <commctrl.h>
#define SHMENUBAR RCDATA
#if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)
#include <aygshell.h>
#define AFXCE_IDR_SCRATCH_SHMENU 28700
#else
#define I_IMAGENONE (-2)
#define NOMENU 0xFFFF
#define IDS_SHNEW 1
#define IDM_SHAREDNEW 10
#define IDM_SHAREDNEWDEFAULT 11
#endif // _WIN32_WCE_PSPC
#define AFXCE_IDD_SAVEMODIFIEDDLG 28701
#define _WIN32_IE 0x0500
#include <commctrl.h>
#endif // _WIN32_WCE
#ifdef RC_INVOKED
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#include "winuser.h" // extract from windows header
#include "winuser.h" // extract from windows header
#endif
#endif
#ifdef IDC_STATIC
#undef IDC_STATIC
#endif
#define IDC_STATIC (-1)
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
......@@ -48,40 +28,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 159, 62
STYLE WS_CHILD | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "TODO: Place controls to manipulate properties of the Control on this dialog.",
IDC_STATIC,15,23,125,16
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 152
TOPMARGIN, 7
BOTTOMMARGIN, 55
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Menubar
......@@ -162,7 +108,7 @@ END
// Data
//
IDR_MENUBAR SHMENUBAR DISCARDABLE
IDR_MENUBAR RCDATA DISCARDABLE
BEGIN
IDR_MENUBAR, 6,
I_IMAGENONE, IDM_FILE, TBSTATE_ENABLED,
......@@ -176,10 +122,10 @@ BEGIN
I_IMAGENONE, IDM_VIDEO, TBSTATE_ENABLED,
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_VIDEO, IDM_VIDEO, 4,
I_IMAGENONE, IDM_NAVIGATION, TBSTATE_ENABLED,
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_NAVIGATION, IDM_NAVIGATION, 5,
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_NAVIGATION, IDM_NAVIGATION, 5
END
IDR_MENUBAR2 SHMENUBAR DISCARDABLE
IDR_MENUBAR2 RCDATA DISCARDABLE
BEGIN
IDR_MENUBAR2, 4,
I_IMAGENONE, IDM_MANAGE, TBSTATE_ENABLED,
......@@ -187,10 +133,9 @@ BEGIN
I_IMAGENONE, IDM_SORT, TBSTATE_ENABLED,
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_SORT, IDM_SORT, 1,
I_IMAGENONE, IDM_SEL, TBSTATE_ENABLED,
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_SEL, IDM_SEL, 2,
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_SEL, IDM_SEL, 2
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
......@@ -268,34 +213,6 @@ BEGIN
PUSHBUTTON "Clear",IDCLEAR,11,7,50,14
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DUMMY, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 83
END
IDD_MESSAGES, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 131
TOPMARGIN, 7
BOTTOMMARGIN, 83
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Menubar
......@@ -306,22 +223,16 @@ BEGIN
MENUITEM "", ID_MENUITEM40108
END
/////////////////////////////////////////////////////////////////////////////
//
// Data
//
IDR_MENUBAR2 RCDATA DISCARDABLE
BEGIN
END
IDR_DUMMYMENU SHMENUBAR DISCARDABLE
IDR_DUMMYMENU RCDATA DISCARDABLE
BEGIN
IDR_DUMMYMENU, 1,
I_IMAGENONE, ID_MENUITEM40108, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE,
IDS_CAP_MENUITEM40109, 0, 0,
IDS_CAP_MENUITEM40109, 0, 0
END
/////////////////////////////////////////////////////////////////////////////
......@@ -404,23 +315,5 @@ BEGIN
IDM_SETTINGS "Settings"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_CAP_XXX "xxx"
END
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
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