]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/wince.h
WinCE: make buildbot happy for now.
[vlc] / modules / gui / wince / wince.h
index 17a290345ff06c49f003ef3fc9ecbe64b2040e35..e7ccf3b8f8014a2e7cebbe9b99ff2d041408baee 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * wince.h: private WinCE interface descriptor
  *****************************************************************************
- * Copyright (C) 1999-2004 VideoLAN
+ * Copyright (C) 1999-2004 the VideoLAN team
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
@@ -19,7 +19,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifndef WINCE_RESOURCE
 #endif
 
 #include "vlc_keys.h"
+#include <vlc_messages.h>
 
 #include <stdio.h>
 #include <string>
 #include <vector>
-using namespace std; 
+using namespace std;
 
 class CBaseWindow;
 class MenuItemExt;
@@ -55,8 +56,11 @@ class VideoWindow;
  *****************************************************************************/
 struct intf_sys_t
 {
+    /* the parent window */
+    CBaseWindow         *p_window;
+
     /* special actions */
-    vlc_bool_t          b_playing;
+    bool          b_playing;
 
     /* The input thread */
     input_thread_t *    p_input;
@@ -64,10 +68,9 @@ struct intf_sys_t
     /* The slider */
     int                 i_slider_pos;                     /* slider position */
     int                 i_slider_oldpos;                /* previous position */
-    vlc_bool_t          b_slider_free;                      /* slider status */
+    bool          b_slider_free;                      /* slider status */
+
 
-    /* The messages window */
-    msg_subscription_t* p_sub;                  /* message bank subscription */
 
     /* Playlist management */
     int                 i_playing;                 /* playlist selected item */
@@ -76,8 +79,6 @@ struct intf_sys_t
     void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
                              intf_dialog_args_t *p_arg );
 
-    CBaseWindow *p_main_window;
-
     /* Dynamic Menu management */
     vector<MenuItemExt*> *p_audio_menu;
     vector<MenuItemExt*> *p_video_menu;
@@ -86,13 +87,9 @@ struct intf_sys_t
 
     VideoWindow          *p_video_window;
 
-    /* GetOpenFileName replacement */
-    BOOL (WINAPI *GetOpenFile)(void *);
-    HMODULE h_gsgetfile_dll;
+    HANDLE   thread_ready;
 };
 
-#define GetOpenFile(a) p_intf->p_sys->GetOpenFile(a)
-
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
@@ -100,7 +97,9 @@ struct intf_sys_t
 class CBaseWindow
 {
 public:
-    CBaseWindow(){ 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() {};
 
     HWND hWnd;                // The main window handle
@@ -108,6 +107,10 @@ public:
     static LRESULT CALLBACK BaseWndProc( HWND, UINT, WPARAM, LPARAM );
     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:
 
     HINSTANCE       hInst;               // The current instance
@@ -116,7 +119,8 @@ protected:
     HINSTANCE       GetInstance () const { return hInst; }
     virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM ) { return 0; };
 
-    intf_thread_t *p_intf;
+    CBaseWindow     *p_parent;
+    intf_thread_t   *p_intf;
 };
 
 class FileInfo;
@@ -126,6 +130,7 @@ class Timer;
 class OpenDialog;
 class PrefsDialog;
 
+CBaseWindow *CreateDialogsProvider( intf_thread_t *, CBaseWindow *, HINSTANCE);
 CBaseWindow *CreateVideoWindow( intf_thread_t *, HWND );
 void PopupMenu( intf_thread_t *, HWND, POINT );
 
@@ -134,12 +139,14 @@ class Interface : public CBaseWindow
 {
 public:
     /* Constructor */
-    Interface(){}
-    ~Interface(){}
+    Interface( intf_thread_t *, CBaseWindow *, HINSTANCE );
+    ~Interface();
 
-    BOOL InitInstance( HINSTANCE, intf_thread_t * );
+    BOOL InitInstance();
 
+    HWND CreateMenuBar( HWND, HINSTANCE );
     void TogglePlayButton( int i_playing_status );
+    void Update();
 
     HWND hwndMain;      // Handle to the main window.
 
@@ -151,33 +158,38 @@ public:
     HWND hwndSB;        // Handle to the status bar.
     HMENU hPopUpMenu;
     HMENU hMenu;
-    FileInfo *fi; // pas besoin de la plupart de ses attributs
-    Messages *hmsg;
-    PrefsDialog *pref;
-    Playlist *pl;
-    Timer *ti;
-    OpenDialog *open;
+
+    Timer *timer;
     CBaseWindow *video;
-    HWND hwndVideo;
 
 protected:
 
     virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
 
-    void OnOpenFileSimple( void );
-    void OnPlayStream( void );
-    void OnVideoOnTop( void );
+    void OnShowDialog( int );
 
-    void OnSliderUpdate( int wp );
-    void OnChange( int wp );
-    void Change( int i_volume );
+    void OnPlayStream( void );
     void OnStopStream( void );
     void OnPrevStream( void );
     void OnNextStream( void );
     void OnSlowStream( 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;
+
+private:
+    HMENU menu_settings;
+    HMENU menu_video;
+    HMENU menu_audio;
+    HMENU menu_navigation;
+
+    bool b_volume_hold;
 };
 
 /* File Info */
@@ -185,38 +197,48 @@ class FileInfo : public CBaseWindow
 {
 public:
     /* Constructor */
-    FileInfo( intf_thread_t *_p_intf, HINSTANCE _hInst );
+    FileInfo( intf_thread_t *, CBaseWindow *, HINSTANCE );
     virtual ~FileInfo(){};
 
+    void UpdateFileInfo(void);
+
 protected:
 
     HWND hwnd_fileinfo;                 // handle to fileinfo window
-    HWND hwndTV;                                // handle to tree-view control 
+    HWND hwndTV;                                // handle to tree-view control
 
     TCHAR szFileInfoClassName[100];     // Main window class name
     TCHAR szFileInfoTitle[100];         // Main window name
 
     virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
-    void UpdateFileInfo( HWND );
     BOOL CreateTreeView( HWND );
 };
 
+struct msg_cb_data_t
+{
+    Messages *self;
+};
+
 /* Messages */
 class Messages : public CBaseWindow
 {
 public:
     /* Constructor */
-    Messages( intf_thread_t *_p_intf, HINSTANCE _hInst );
-    virtual ~Messages(){};
+    Messages( intf_thread_t *, CBaseWindow *, HINSTANCE );
+     ~Messages();
+
+    static void sinkMessage (msg_cb_data_t *, msg_item_t *, unsigned);
+    void sinkMessage (msg_item_t *item, unsigned);
 
 protected:
 
     virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
 
+    /* The messages window */
+    msg_subscription_t* sub;                  /* message bank subscription */
+    msg_cb_data_t *cb_data;
     HWND hListView;
-    void UpdateLog(void);
-
-    vlc_bool_t b_verbose;
+    bool b_verbose;
 };
 
 /* ItemInfo Dialog */
@@ -224,7 +246,8 @@ class ItemInfoDialog : public CBaseWindow
 {
 public:
     /* Constructor */
-    ItemInfoDialog( intf_thread_t *, HINSTANCE, playlist_item_t * );
+    ItemInfoDialog( intf_thread_t *, CBaseWindow *,
+                    HINSTANCE, playlist_item_t * );
     virtual ~ItemInfoDialog(){};
 
 protected:
@@ -259,13 +282,14 @@ class OpenDialog : public CBaseWindow
 {
 public:
     /* Constructor */
-    OpenDialog( intf_thread_t *_p_intf, HINSTANCE _hInst,
-                int _i_access_method, int _i_arg, int _i_method );
+    OpenDialog( intf_thread_t *, CBaseWindow *, HINSTANCE, int, int );
     virtual ~OpenDialog(){};
 
     void UpdateMRL();
     void UpdateMRL( int i_access_method );
 
+    HWND file_combo;
+
 protected:
 
     virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
@@ -277,7 +301,6 @@ protected:
 
     HWND notebook;
 
-    HWND file_combo;
     HWND browse_button;
     HWND subsfile_checkbox;
     HWND subsfile_label;
@@ -294,12 +317,11 @@ protected:
 
     HWND net_addrs_label[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_access;
     int i_net_type;
-        
+
     void FilePanel( HWND hwnd );
     void NetPanel( HWND hwnd );
 
@@ -325,16 +347,16 @@ class SubsFileDialog: public CBaseWindow
 {
 public:
     /* Constructor */
-    SubsFileDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
+    SubsFileDialog( intf_thread_t *, CBaseWindow *, HINSTANCE );
     virtual ~SubsFileDialog(){};
 
     vector<string> subsfile_mrl;
+    HWND file_combo;
 
 protected:
     friend class OpenDialog;
 
     HWND file_box;
-    HWND file_combo;
     HWND browse_button;
 
     HWND enc_box;
@@ -360,9 +382,12 @@ class Playlist : public CBaseWindow
 {
 public:
     /* Constructor */
-    Playlist( intf_thread_t *_p_intf, HINSTANCE _hInst );
+    Playlist( intf_thread_t *, CBaseWindow *, HINSTANCE );
     virtual ~Playlist(){};
 
+    void UpdatePlaylist();
+    void ShowPlaylist( bool );
+
 protected:
 
     bool b_need_update;
@@ -375,7 +400,6 @@ protected:
     HWND hwndTB;        // Handle to the toolbar.
     HWND hListView;
 
-    void UpdatePlaylist();
     void Rebuild();
     void UpdateItem( int );
     LRESULT ProcessCustomDraw( LPARAM lParam );
@@ -385,8 +409,6 @@ protected:
 
     void OnOpen();
     void OnSave();
-    void OnAddFile( vlc_bool_t );
-    void OnAddMRL();
 
     void OnDeleteSelection();
     void OnInvertSelection();
@@ -419,9 +441,9 @@ class Timer
 {
 public:
     /* 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();
-    void Notify( void ); 
+    void Notify( void );
 
 private:
     intf_thread_t *p_intf;
@@ -437,11 +459,11 @@ void RefreshAudioMenu( intf_thread_t *_p_intf, HMENU hMenu );
 void RefreshVideoMenu( intf_thread_t *_p_intf, HMENU hMenu );
 void RefreshNavigMenu( intf_thread_t *_p_intf, HMENU hMenu );
 void RefreshMenu( intf_thread_t *, vector<MenuItemExt*> *, HMENU, int,
-                  char **, int *, int );
+                  char **, vlc_object_t **, int );
 int wce_GetMenuItemCount( HMENU );
 void CreateMenuItem( intf_thread_t *, vector<MenuItemExt*> *, HMENU, char *,
                      vlc_object_t *, int * );
-HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *, 
+HMENU CreateChoicesMenu( intf_thread_t *, vector<MenuItemExt*> *, char *,
                          vlc_object_t *, int * );
 void OnMenuEvent( intf_thread_t *, int );
 
@@ -454,15 +476,17 @@ class MenuItemExt
 public:
     /* Constructor */
     MenuItemExt( intf_thread_t *_p_intf, int _id, char *_psz_var,
-                 int _i_object_id, vlc_value_t _val, int _i_val_type );
+                 vlc_object_t * p_object, vlc_value_t _val, int _i_val_type );
 
     virtual ~MenuItemExt();
 
+    static void ClearList( vector<MenuItemExt*> * );
+
     int id;
     intf_thread_t *p_intf;
     char *psz_var;
     int  i_val_type;
-    int  i_object_id;
+    vlc_object_t * p_object;
     vlc_value_t val;
 
 private:
@@ -477,7 +501,7 @@ class PrefsDialog: public CBaseWindow
 {
 public:
     /* Constructor */
-    PrefsDialog( intf_thread_t *_p_intf, HINSTANCE _hInst );
+    PrefsDialog( intf_thread_t *, CBaseWindow *, HINSTANCE );
     virtual ~PrefsDialog(){};
 
 protected:
@@ -522,17 +546,12 @@ protected:
 #   define _TOMB(a) a
 #endif
 
-#if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
-#   define ISUTF8 1
-#else // ENABLE_NLS && ENABLE_UTF8
-#   define ISUTF8 0
-#endif
-
 /*****************************************************************************
  * Misc definitions (mainly from aygshell.h)
  *****************************************************************************/
 #define _WIN32_IE 0x0500
 
+#define SHFS_SHOWSIPBUTTON          0x0004
 #define SHFS_HIDESIPBUTTON          0x0008
 #define SHIDIM_FLAGS                0x0001
 #define SHIDIF_DONEBUTTON           0x0001
@@ -540,7 +559,6 @@ protected:
 #define SHIDIF_FULLSCREENNOMENUBAR  0x0010
 #define SHCMBF_HMENU                0x0010
 #define SHCMBF_EMPTYBAR             0x0001
-#define SHFS_SHOWSIPBUTTON          0x0004
 #define GN_CONTEXTMENU              1000
 #define SHRG_RETURNCMD              0x0001
 #define SHRG_NOTIFYPARENT           0x0002
@@ -599,6 +617,29 @@ extern "C" {
     } SHRGINFO, *PSHRGINFO;
 
     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 )
@@ -606,6 +647,9 @@ extern "C" {
 #   define SHInitDialog(a)
 #   define SHCreateMenuBar(a) 1
 #   define SHRecognizeGesture(a) 0
+#   define SHSipPreference(a,b)
+
+#   define SHSipInfo(a,b,c,d) 0
 #endif
 
 #endif //WINCE_RESOURCE
@@ -640,7 +684,8 @@ extern "C" {
 #define IDM_NAVIGATION                  40053
 #define ID_FILE_QUICKOPEN               40057
 #define ID_FILE_OPENFILE                40058
-#define ID_FILE_OPENNET                 40059
+#define ID_FILE_OPENDIR                 40059
+#define ID_FILE_OPENNET                 40060
 #define ID_FILE_EXIT                    40061
 #define ID_VIEW_PLAYLIST                40063
 #define ID_VIEW_MESSAGES                40064