]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wince: WinCE build fixes.
authorGildas Bazin <gbazin@videolan.org>
Tue, 15 Feb 2005 21:56:54 +0000 (21:56 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 15 Feb 2005 21:56:54 +0000 (21:56 +0000)
14 files changed:
modules/gui/wince/fileinfo.cpp
modules/gui/wince/interface.cpp
modules/gui/wince/iteminfo.cpp
modules/gui/wince/menus.cpp
modules/gui/wince/messages.cpp
modules/gui/wince/open.cpp
modules/gui/wince/playlist.cpp
modules/gui/wince/preferences.cpp
modules/gui/wince/preferences_widgets.cpp
modules/gui/wince/subtitles.cpp
modules/gui/wince/timer.cpp
modules/gui/wince/wince.cpp
modules/gui/wince/wince.h
modules/gui/wince/wince.rc

index a1d2b526f43ea999e2dbbf4840475a0e5f6829a6..6e0f719273e2d4b40bf36c23875a6ba5c65eeba6 100644 (file)
 /*****************************************************************************
  * 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.
  *****************************************************************************/
index 8721246f6bd8341a1e190ad2d1fa174d80c0957f..d72f8c99ebf1903ed2e959c599936d002cb7b7e2 100644 (file)
 #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
index 4b897a44d4973bf7ac1120be1ce5f87ed1305c14..ec94b05bf851fb6b87c596cc2c05f8f328ba1e44 100644 (file)
 /*****************************************************************************
  * 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.
  *****************************************************************************/
index dc8e69cb3297758a8674929fc7cbea296488b867..d8878b376ed6f94b61fd28923136a051b994c4b5 100644 (file)
 #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>
 
index 3e4e863d7f0b41ee493b4648a7caa74918c785af..d122b5d080b646737e8d930b85b9576525e09748 100644 (file)
 /*****************************************************************************
  * 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
index dba02a1e65e40b04dacfa854a42c99809d9a86f7..ec9b59ce6bdc1fc50ff331e5064e955a363d927c 100644 (file)
 /*****************************************************************************
  * 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.
  *****************************************************************************/
index 559dbc5a84f0ceb6ea95f6c7159e92c1c65570cb..c9e5558d8277782ca4d6430b7d04f7e5abfa60f0 100644 (file)
 /*****************************************************************************
  * 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  
index 742cd0b9f59ccf0b17ddfa44d3e6c0e004002d18..4b55b7cef5ec14d8c5b0703fa0e03a5947e41b5b 100644 (file)
 /*****************************************************************************
  * 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
index 1dabec9f51d89b959554e56a58c455ca9196910c..c638baae1a0efc1691f710a0e526a0f2cf93fecd 100644 (file)
 #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"
 
 /*****************************************************************************
index ee166a1fe9bcd777d71a915c883900edacb33264..b4f19e7caafbc403fc2395d436f6d67815b4e8f9 100644 (file)
 /*****************************************************************************
  * 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.
  *****************************************************************************/
index 7a85340f80d015f5750bfb2de80e3787a7365d41..2da84181716b5fd0e760a3548a18562a11c7bb34 100644 (file)
 #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 );
index e9826a1b97ffb7b46c59b5feab68e45b45bc1dad..45eba2fac70649a107e38141bffa5f24e44faf2e 100644 (file)
 #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
index 67e29b77d3655e04a9880fa570e82221d1137717..072df8c8b94ea2edb7ee57915a7a9e44fc794aad 100644 (file)
 
 #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
 #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
index 43115e6eb9c5f0118cc2474e5871abfee57887a1..a414246a28d159eae3e5fd687f245890f408c313 100644 (file)
@@ -8,37 +8,17 @@
 #endif\r
 \r
 #if defined(_WIN32_WCE)\r
-       #if !defined(WCEOLE_ENABLE_DIALOGEX)\r
-               #define DIALOGEX DIALOG DISCARDABLE\r
-       #endif\r
-       #include <commctrl.h>\r
-       #define  SHMENUBAR RCDATA\r
-       #if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)\r
-               #include <aygshell.h>\r
-               #define AFXCE_IDR_SCRATCH_SHMENU  28700\r
-       #else\r
-               #define I_IMAGENONE             (-2)\r
-               #define NOMENU                  0xFFFF\r
-               #define IDS_SHNEW               1\r
-\r
-               #define IDM_SHAREDNEW        10\r
-               #define IDM_SHAREDNEWDEFAULT 11\r
-       #endif // _WIN32_WCE_PSPC\r
-       #define AFXCE_IDD_SAVEMODIFIEDDLG 28701\r
+    #define _WIN32_IE 0x0500\r
+    #include <commctrl.h>\r
 #endif // _WIN32_WCE\r
 \r
 #ifdef RC_INVOKED\r
 #ifndef _INC_WINDOWS\r
 #define _INC_WINDOWS\r
-       #include "winuser.h"           // extract from windows header\r
+    #include "winuser.h" // extract from windows header\r
 #endif\r
 #endif\r
 \r
-#ifdef IDC_STATIC\r
-#undef IDC_STATIC\r
-#endif\r
-#define IDC_STATIC      (-1)\r
-\r
 /////////////////////////////////////////////////////////////////////////////\r
 // English (U.S.) resources\r
 \r
@@ -48,40 +28,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 #pragma code_page(1252)\r
 #endif //_WIN32\r
 \r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Dialog\r
-//\r
-\r
-IDD_ABOUT DIALOG DISCARDABLE  0, 0, 159, 62\r
-STYLE WS_CHILD | WS_CAPTION | WS_SYSMENU\r
-CAPTION "About"\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    LTEXT           "TODO: Place controls to manipulate properties of the Control on this dialog.",\r
-                    IDC_STATIC,15,23,125,16\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// DESIGNINFO\r
-//\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-GUIDELINES DESIGNINFO DISCARDABLE \r
-BEGIN\r
-    IDD_ABOUT, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 7\r
-        RIGHTMARGIN, 152\r
-        TOPMARGIN, 7\r
-        BOTTOMMARGIN, 55\r
-    END\r
-END\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-\r
 /////////////////////////////////////////////////////////////////////////////\r
 //\r
 // Menubar\r
@@ -162,7 +108,7 @@ END
 // Data\r
 //\r
 \r
-IDR_MENUBAR SHMENUBAR DISCARDABLE \r
+IDR_MENUBAR RCDATA DISCARDABLE \r
 BEGIN\r
     IDR_MENUBAR, 6,\r
     I_IMAGENONE, IDM_FILE, TBSTATE_ENABLED, \r
@@ -176,10 +122,10 @@ BEGIN
     I_IMAGENONE, IDM_VIDEO, TBSTATE_ENABLED, \r
     TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_VIDEO, IDM_VIDEO, 4,\r
     I_IMAGENONE, IDM_NAVIGATION, TBSTATE_ENABLED, \r
-    TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_NAVIGATION, IDM_NAVIGATION, 5,\r
+    TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_NAVIGATION, IDM_NAVIGATION, 5\r
 END\r
 \r
-IDR_MENUBAR2 SHMENUBAR DISCARDABLE \r
+IDR_MENUBAR2 RCDATA DISCARDABLE \r
 BEGIN\r
     IDR_MENUBAR2, 4,\r
     I_IMAGENONE, IDM_MANAGE, TBSTATE_ENABLED, \r
@@ -187,10 +133,9 @@ BEGIN
     I_IMAGENONE, IDM_SORT, TBSTATE_ENABLED, \r
     TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_SORT, IDM_SORT, 1,\r
     I_IMAGENONE, IDM_SEL, TBSTATE_ENABLED, \r
-    TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_SEL, IDM_SEL, 2,\r
+    TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDM_SEL, IDM_SEL, 2\r
 END\r
 \r
-\r
 /////////////////////////////////////////////////////////////////////////////\r
 //\r
 // String Table\r
@@ -268,34 +213,6 @@ BEGIN
     PUSHBUTTON      "Clear",IDCLEAR,11,7,50,14\r
 END\r
 \r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// DESIGNINFO\r
-//\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-GUIDELINES DESIGNINFO DISCARDABLE \r
-BEGIN\r
-    IDD_DUMMY, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 7\r
-        RIGHTMARGIN, 179\r
-        TOPMARGIN, 7\r
-        BOTTOMMARGIN, 83\r
-    END\r
-\r
-    IDD_MESSAGES, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 7\r
-        RIGHTMARGIN, 131\r
-        TOPMARGIN, 7\r
-        BOTTOMMARGIN, 83\r
-    END\r
-END\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-\r
 /////////////////////////////////////////////////////////////////////////////\r
 //\r
 // Menubar\r
@@ -306,22 +223,16 @@ BEGIN
     MENUITEM "",                            ID_MENUITEM40108\r
 END\r
 \r
-\r
 /////////////////////////////////////////////////////////////////////////////\r
 //\r
 // Data\r
 //\r
 \r
-IDR_MENUBAR2 RCDATA DISCARDABLE \r
-BEGIN\r
-\r
-END\r
-\r
-IDR_DUMMYMENU SHMENUBAR DISCARDABLE \r
+IDR_DUMMYMENU RCDATA DISCARDABLE \r
 BEGIN\r
     IDR_DUMMYMENU, 1,\r
     I_IMAGENONE, ID_MENUITEM40108, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, \r
-    IDS_CAP_MENUITEM40109, 0, 0,\r
+    IDS_CAP_MENUITEM40109, 0, 0\r
 END\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
@@ -404,23 +315,5 @@ BEGIN
     IDM_SETTINGS            "Settings"\r
 END\r
 \r
-STRINGTABLE DISCARDABLE \r
-BEGIN\r
-    IDS_CAP_XXX             "xxx"\r
-END\r
-\r
 #endif    // French (France) resources\r
 /////////////////////////////////////////////////////////////////////////////\r
-\r
-\r
-\r
-#ifndef APSTUDIO_INVOKED\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Generated from the TEXTINCLUDE 3 resource.\r
-//\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-#endif    // not APSTUDIO_INVOKED\r
-\r