]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/qt4.hpp
Qt: playlist dialog: remove unneeded layer
[vlc] / modules / gui / qt4 / qt4.hpp
index 577d43417ff312bf3e36ccb8fc554c37984cb819..a1cd027cb7ea71569b74328872eb23ff8c263352 100644 (file)
 #include <vlc_common.h>    /* VLC_COMMON_MEMBERS for vlc_interface.h */
 #include <vlc_interface.h> /* intf_thread_t */
 #include <vlc_playlist.h>  /* playlist_t */
-#include <vlc_aout.h>      /* AOUT_VOLUME_ */
 
 #define QT_NO_CAST_TO_ASCII
 #include <QString>
 
-#if ( QT_VERSION < 0x040400 )
-# error Update your Qt version to at least 4.4.0
-#endif
-#if QT_VERSION == 0x040500
-# error Please update Qt version to 4.5.1. 4.5.0 is too buggy
+#if ( QT_VERSION < 0x040600 )
+# error Update your Qt version to at least 4.6.0
 #endif
 
-#define HAS_QT45 ( QT_VERSION >= 0x040500 )
+#define HAS_QT47 ( QT_VERSION >= 0x040700 )
 
 enum {
     DialogEventType = 0,
@@ -53,31 +49,41 @@ enum {
     MsgEventType    = 300,
 };
 
+enum{
+    NOTIFICATION_NEVER = 0,
+    NOTIFICATION_MINIMIZED = 1,
+    NOTIFICATION_ALWAYS = 2,
+};
+
 class QVLCApp;
 class QMenu;
 class MainInterface;
 class QSettings;
+class PLModel;
 
 struct intf_sys_t
 {
     vlc_thread_t thread;
 
     QVLCApp *p_app;          /* Main Qt Application */
+
     MainInterface *p_mi;     /* Main Interface, NULL if DialogProvider Mode */
 
     QSettings *mainSettings; /* Qt State settings not messing main VLC ones */
 
-    bool b_isDialogProvider; /* Qt mode or Skins mode */
-
-    int  i_screenHeight;     /* Detection of Small screens */
-
-    playlist_t *p_playlist;  /* Core Playlist discussion */
+    PLModel *pl_model;
 
     QString filepath;        /* Last path used in dialogs */
 
+    int  i_screenHeight;     /* Detection of Small screens */
+
+    bool b_isDialogProvider; /* Qt mode or Skins mode */
+#ifdef WIN32
+    bool disable_volume_keys;
+#endif
 };
 
-#define THEPL p_intf->p_sys->p_playlist
+#define THEPL pl_Get(p_intf)
 #define QPL_LOCK playlist_Lock( THEPL );
 #define QPL_UNLOCK playlist_Unlock( THEPL );
 
@@ -90,10 +96,10 @@ struct intf_sys_t
 #define qtu( i ) ((i).toUtf8().constData())
 
 #define CONNECT( a, b, c, d ) \
-        connect( a, SIGNAL( b ), c, SLOT(d) )
+        connect( a, SIGNAL(b), c, SLOT(d) )
 #define DCONNECT( a, b, c, d ) \
-        connect( a, SIGNAL( b ), c, SLOT(d), Qt::DirectConnection )
-#define BUTTONACT( b, a ) connect( b, SIGNAL( clicked() ), this, SLOT(a) )
+        connect( a, SIGNAL(b), c, SLOT(d), Qt::DirectConnection )
+#define BUTTONACT( b, a ) connect( b, SIGNAL(clicked()), this, SLOT(a) )
 
 #define BUTTON_SET( button, text, tooltip )  \
     button->setText( text );                 \
@@ -116,10 +122,10 @@ struct intf_sys_t
 #define TOGGLEV( x ) { if( x->isVisible() ) x->hide();          \
             else  x->show(); }
 
-#define getSettings() p_intf->p_sys->mainSettings
+/* for widgets which must not follow the RTL auto layout changes */
+#define RTL_UNAFFECTED_WIDGET setLayoutDirection( Qt::LeftToRight );
 
-#define QT_VOLUME_DEFAULT AOUT_VOLUME_DEFAULT
-#define QT_VOLUME_MAX (AOUT_VOLUME_DEFAULT * 2)
+#define getSettings() p_intf->p_sys->mainSettings
 
 static inline QString QVLCUserDir( vlc_userdir_t type )
 {
@@ -131,4 +137,10 @@ static inline QString QVLCUserDir( vlc_userdir_t type )
     return res;
 }
 
+/* After this day of the year, the usual VLC cone is replaced by another cone
+ * wearing a Father Xmas hat.
+ * Note this icon doesn't represent an endorsment of Coca-Cola company.
+ */
+#define QT_XMAS_JOKE_DAY 354
+
 #endif