]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.hpp
Disable unused code.
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
index f81197bd18efb5a828190d5867e59e2b21a0bf4c..3c0a880d7818a3e2a185af8dcb83af19f30bf83e 100644 (file)
@@ -30,7 +30,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_interface.h>
 #include <vlc_aout.h>
 
 
 #include <QWidget>
 #include <QFrame>
+
 #define VOLUME_MAX 200
 
+/* on WIN32 hide() for fullscreen controller doesnt work, so it have to be
+   done by trick with setting the opacity of window */
+#ifdef WIN32
+    #define WIN32TRICK
+#endif
+
+/* to trying transparency with fullscreen controller on windows enable that */
+/* it can be enabled on-non windows systems,
+   but it will be transparent only with composite manager */
+#ifndef WIN32
+    #define HAVE_TRANSPARENCY 1
+#else
+    #define HAVE_TRANSPARENCY 0
+#endif
+
+/* Default value of opacity for FS controller */
+#define DEFAULT_OPACITY 0.75
+
 class ResizeEvent;
 class QPalette;
 class QPixmap;
@@ -66,17 +85,23 @@ public:
     virtual QSize sizeHint() const;
 private:
     intf_thread_t *p_intf;
-    vout_thread_t *p_vout;
+    int i_vout;
 
-    vlc_mutex_t lock;
     QSize videoSize;
 
 signals:
-    void askVideoWidgetToShow();
-    //void askResize();
+    void askVideoWidgetToShow( unsigned int, unsigned int );
 
 public slots:
     void SetSizing( unsigned int, unsigned int );
+
+protected:
+    virtual QPaintEngine *paintEngine() const
+    {
+        return NULL;
+    }
+
+    virtual void paintEvent(QPaintEvent *);
 };
 
 /******************** Background Widget ****************/
@@ -98,6 +123,7 @@ public slots:
     void updateArt( QString );
 };
 
+#if 0
 class VisualSelector : public QFrame
 {
     Q_OBJECT
@@ -111,6 +137,7 @@ private slots:
     void prev();
     void next();
 };
+#endif
 
 /* Advanced Button Bar */
 class QPushButton;
@@ -155,7 +182,8 @@ class ControlsWidget : public QFrame
     Q_OBJECT
 public:
     /* p_intf, advanced control visible or not, blingbling or not */
-    ControlsWidget( intf_thread_t *, MainInterface*, bool, bool );
+    ControlsWidget( intf_thread_t *_p_i, MainInterface *_p_mi,
+        bool b_advControls, bool b_shiny, bool b_fsCreation = false);
     virtual ~ControlsWidget();
 
     QPushButton *playlistButton;
@@ -167,21 +195,27 @@ public slots:
 protected:
     friend class MainInterface;
     friend class VolumeClickHandler;
-private:
+protected:
     intf_thread_t       *p_intf;
     QWidget             *discFrame;
     QWidget             *telexFrame;
     QGridLayout         *controlLayout;
     InputSlider         *slider;
     QPushButton         *prevSectionButton, *nextSectionButton, *menuButton;
-    QPushButton         *playButton, *fullscreenButton;
+    QPushButton         *playButton, *fullscreenButton, *extSettingsButton;
+    QPushButton         *telexTransparent, *telexOn;
+    QSpinBox            *telexPage;
     QToolButton         *slowerButton, *fasterButton;
+    QHBoxLayout         *controlButLayout;
     AdvControlsWidget   *advControls;
     QLabel              *volMuteLabel;
     QAbstractSlider     *volumeSlider;
+    VolumeClickHandler  *hVolLabel;
 
     bool                 b_advancedVisible;
-private slots:
+    bool                 b_telexTransparent;
+    bool                 b_telexEnabled;
+protected slots:
     void play();
     void stop();
     void prev();
@@ -194,10 +228,74 @@ private slots:
     void faster();
     void slower();
     void toggleAdvanced();
+    void toggleTeletext();
+    void toggleTeletextTransparency();
+    void enableTeletext( bool );
 signals:
     void advancedControlsToggled( bool );
 };
 
+/***********************************
+ * Fullscreen controller
+ ***********************************/
+class FullscreenControllerWidget : public ControlsWidget
+{
+    Q_OBJECT
+public:
+    FullscreenControllerWidget( intf_thread_t *, MainInterface*, bool, bool );
+    virtual ~FullscreenControllerWidget();
+
+    /* */
+    void attachVout( vout_thread_t *p_vout );
+    void detachVout( vout_thread_t *p_vout );
+    void fullscreenChanged( vout_thread_t *, bool b_fs, int i_timeout );
+
+protected:
+    friend class MainInterface;
+    friend class VolumeClickHandler;
+
+    virtual void mouseMoveEvent( QMouseEvent *event );
+    virtual void mousePressEvent( QMouseEvent *event );
+    virtual void enterEvent( QEvent *event );
+    virtual void leaveEvent( QEvent *event );
+    virtual void keyPressEvent( QKeyEvent *event );
+
+private slots:
+    void showFSC();
+    void planHideFSC();
+    void hideFSC();
+
+    void slowHideFSC();
+
+
+private:
+    QTimer *p_hideTimer;
+#if HAVE_TRANSPARENCY
+    QTimer *p_slowHideTimer;
+#endif
+
+    int i_mouse_last_x;
+    int i_mouse_last_y;
+
+    bool b_mouse_over;
+
+    bool b_slow_hide_begin;
+    int  i_slow_hide_timeout;
+
+#ifdef WIN32TRICK
+    bool fscHidden;
+#endif
+
+    virtual void customEvent( QEvent *event );
+
+    /* Shared variable between FSC and VLC (protected by a lock) */
+    vlc_mutex_t lock;
+    bool        b_fullscreen;
+    int         i_hide_timeout;  /* FSC hiding timeout, same as mouse hiding timeout */
+};
+
+
+
 class VolumeClickHandler : public QObject
 {
 public: