]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/main_interface.hpp
Qt4 streaming with dshow mrl fix
[vlc] / modules / gui / qt4 / main_interface.hpp
index b2c088e5208934be3b10af518fdebc00572d1860..2a441d0c246d9ca05088a66ca1358135284669ab 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef _MAIN_INTERFACE_H_
-#define _MAIN_INTERFACE_H_
+#ifndef QVLC_MAIN_INTERFACE_H_
+#define QVLC_MAIN_INTERFACE_H_
 
 #include "qt4.hpp"
 
 #include "util/qvlcframe.hpp"
 #include "components/preferences_widgets.hpp" /* First Start */
+#ifdef WIN32
+ #include <vlc_windows_interfaces.h>
+#endif
 
 #include <QSystemTrayIcon>
 
@@ -47,15 +50,18 @@ class ControlsWidget;
 class InputControlsWidget;
 class FullscreenControllerWidget;
 class SpeedControlWidget;
+class QVBoxLayout;
 class QMenu;
 class QSize;
+class QStackedWidget;
 
 enum {
-    CONTROLS_VISIBLE = 0x1,
-    CONTROLS_HIDDEN = 0x2,
+    CONTROLS_VISIBLE  = 0x1,
+    CONTROLS_HIDDEN   = 0x2,
     CONTROLS_ADVANCED = 0x4,
 };
 
+
 typedef enum pl_dock_e {
     PL_UNDOCKED,
     PL_BOTTOM,
@@ -67,7 +73,6 @@ class MainInterface : public QVLCMW
 {
     Q_OBJECT;
 
-    friend class InteractionDialog;
     friend class PlaylistWidget;
 
 public:
@@ -75,50 +80,60 @@ public:
     virtual ~MainInterface();
 
     /* Video requests from core */
-    WId requestVideo( vout_thread_t *p_nvout, int *pi_x,
-                      int *pi_y, unsigned int *pi_width,
-                      unsigned int *pi_height );
+    WId getVideo( int *pi_x, int *pi_y,
+                  unsigned int *pi_width, unsigned int *pi_height );
     void releaseVideo( void  );
     int controlVideo( int i_query, va_list args );
 
     /* Getters */
-    QSystemTrayIcon *getSysTray() { return sysTray; };
-    QMenu *getSysTrayMenu() { return systrayMenu; };
+#ifndef HAVE_MAEMO
+    QSystemTrayIcon *getSysTray() { return sysTray; }
+    QMenu *getSysTrayMenu() { return systrayMenu; }
+#endif
     int getControlsVisibilityStatus();
 
     /* Sizehint() */
     virtual QSize sizeHint() const;
 
 protected:
-//    void resizeEvent( QResizeEvent * );
-    void dropEvent( QDropEvent *);
     void dropEventPlay( QDropEvent *, bool);
-    void dragEnterEvent( QDragEnterEvent * );
-    void dragMoveEvent( QDragMoveEvent * );
-    void dragLeaveEvent( QDragLeaveEvent * );
-    void closeEvent( QCloseEvent *);
+    virtual void dropEvent( QDropEvent *);
+    virtual void dragEnterEvent( QDragEnterEvent * );
+    virtual void dragMoveEvent( QDragMoveEvent * );
+    virtual void dragLeaveEvent( QDragLeaveEvent * );
+    virtual void closeEvent( QCloseEvent *);
+    virtual void customEvent( QEvent *);
+    virtual void keyPressEvent( QKeyEvent *);
+    virtual void wheelEvent( QWheelEvent * );
+    virtual void resizeEvent( QResizeEvent * event );
 
 private:
+    void createMainWidget( QSettings* );
+    void createStatusBar();
+
+    /* Systray */
+    void handleSystray();
+    void createSystray();
+    void initSystray();
+    bool isDocked() { return ( i_pl_dock != PL_UNDOCKED ); }
+
+    void showTab( int i_tab );
+    void restoreStackOldWidget();
+    void showVideo() { showTab( VIDEO_TAB ); }
+    void showBg() { showTab( BACKG_TAB ); }
+    void hideStackWidget() { showTab( HIDDEN_TAB ); }
+
     QSettings           *settings;
+#ifndef HAVE_MAEMO
     QSystemTrayIcon     *sysTray;
     QMenu               *systrayMenu;
+#endif
     QString              input_name;
     QVBoxLayout         *mainLayout;
     ControlsWidget      *controls;
     InputControlsWidget *inputC;
     FullscreenControllerWidget *fullscreenControls;
-
-    void handleMainUi( QSettings* );
-    void askForPrivacy();
-    int  privacyDialog( QList<ConfigControl *> *controls );
-
-    /* Systray */
-    void handleSystray();
-    void createSystray();
-    void initSystray();
-
-    void createStatusBar();
-
+    QStackedWidget      *stackCentralW;
     /* Video */
     VideoWidget         *videoWidget;
 
@@ -126,66 +141,87 @@ private:
     VisualSelector      *visualSelector;
     PlaylistWidget      *playlistWidget;
 
-    bool                 videoIsActive;       ///< Having a video now / THEMIM->hasV
+    /* Status Bar */
+    QLabel              *nameLabel;
+    QLabel              *cryptedLabel;
+
+    /* Status and flags */
+    enum {
+        HIDDEN_TAB = -1,
+        BACKG_TAB  =  0,
+        VIDEO_TAB  = 1,
+        PLAYL_TAB  = 2,
+    };
+    int                  stackCentralOldState;
+
+//    bool                 videoIsActive;       ///< Having a video now / THEMIM->hasV
     bool                 videoEmbeddedFlag;   ///< Want an external Video Window
     bool                 playlistVisible;     ///< Is the playlist visible ?
     bool                 visualSelectorEnabled;
     bool                 notificationEnabled; /// Systray Notifications
-    bool                 bgWasVisible;
+
     bool                 b_keep_size;         ///< persistent resizeable window
     QSize                mainBasedSize;       ///< based Wnd (normal mode only)
     QSize                mainVideoSize;       ///< Wnd with video (all modes)
     int                  i_visualmode;        ///< Visual Mode
     pl_dock_e            i_pl_dock;
-    bool                 isDocked() { return ( i_pl_dock != PL_UNDOCKED ); }
+    int                  i_bg_height;         ///< Save height of bgWidget
+    bool                 b_hideAfterCreation;
 
-    /* Status Bar */
-    QLabel              *nameLabel;
-#if 0
-    QLabel              *cryptedLabel;
+#ifdef WIN32
+    HIMAGELIST himl;
+    LPTASKBARLIST3 p_taskbl;
+    void createTaskBarButtons();
 #endif
-
-    virtual void customEvent( QEvent *);
-    virtual void keyPressEvent( QKeyEvent *);
-    virtual void wheelEvent( QWheelEvent * );
-    virtual void resizeEvent( QResizeEvent * event );
+    void createPlaylist( bool );
 
 public slots:
     void undockPlaylist();
     void dockPlaylist( pl_dock_e i_pos = PL_BOTTOM );
     void toggleMinimalView( bool );
     void togglePlaylist();
+#ifndef HAVE_MAEMO
     void toggleUpdateSystrayMenu();
+#endif
     void toggleAdvanced();
     void toggleFullScreen();
     void toggleFSC();
+    void popupMenu( const QPoint& );
+    void changeThumbbarButtons( int );
 
     /* Manage the Video Functions from the vout threads */
+    void getVideoSlot( WId *p_id, int *pi_x, int *pi_y,
+                       unsigned *pi_width, unsigned *pi_height );
     void releaseVideoSlot( void );
 
 private slots:
     void debug();
+    void destroyPopupMenu();
+    void recreateToolbars();
     void doComponentsUpdate();
-    void setName( QString );
-    void setVLCWindowsTitle( QString title = "" );
+    void setName( const QString& );
+    void setVLCWindowsTitle( const QString& title = "" );
 #if 0
     void visual();
 #endif
+#ifndef HAVE_MAEMO
     void handleSystrayClick( QSystemTrayIcon::ActivationReason );
-    void updateSystrayTooltipName( QString );
+    void updateSystrayTooltipName( const QString& );
     void updateSystrayTooltipStatus( int );
-
-#if 0
-    void showCryptedLabel( bool );
 #endif
+    void showCryptedLabel( bool );
+
+    void handleKeyPress( QKeyEvent * );
+
 signals:
+    void askGetVideo( WId *p_id, int *pi_x, int *pi_y,
+                      unsigned *pi_width, unsigned *pi_height );
     void askReleaseVideo( );
     void askVideoToResize( unsigned int, unsigned int );
-    void askVideoToShow( unsigned int, unsigned int );
-    void askVideoToToggle();
-    void askBgWidgetToToggle();
+    void askVideoSetFullScreen( bool );
     void askUpdate();
     void minimalViewToggled( bool );
+    void fullscreenInterfaceToggled( bool );
 };
 
 #endif