]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/qt4.hpp
Qt: compressor: simplify by grouping
[vlc] / modules / gui / qt4 / qt4.hpp
index c93754a4a1b794f974d8bdb493273e03ff9a8cbc..b048e5a64a3cdd21f7ce05f57e41c5daf7ed42ec 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * qt4.hpp : QT4 interface
+ * qt4.hpp : Qt interface
  ****************************************************************************
  * Copyright (C) 2006-2009 the VideoLAN team
  * $Id$
 #include <vlc_interface.h> /* intf_thread_t */
 #include <vlc_playlist.h>  /* playlist_t */
 
-#include <QEvent>
+#define QT_NO_CAST_TO_ASCII
 #include <QString>
 
-#if ( QT_VERSION < 0x040400 )
-# error Update your Qt version
-#endif
-#if QT_VERSION == 0x040500
-# warning Please update Qt version to 4.5.1. This warning will become an error.
+#if ( QT_VERSION < 0x040600 )
+# error Update your Qt version to at least 4.6.0
 #endif
 
+#define HAS_QT47 ( QT_VERSION >= 0x040700 )
+
 enum {
-    QT_NORMAL_MODE = 0,
-    QT_ALWAYS_VIDEO_MODE,
-    QT_MINIMAL_MODE
+    DialogEventTypeOffset = 0,
+    IMEventTypeOffset     = 100,
+    PLEventTypeOffset     = 200,
+    MsgEventTypeOffset    = 300,
 };
 
-enum {
-    DialogEventType = 0,
-    IMEventType     = 100,
-    PLEventType     = 200,
-    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 */
 
-    QMenu * p_popup_menu;    /* The right click menu */
+    int  i_screenHeight;     /* Detection of Small screens */
+    unsigned voutWindowType; /* Type of vout_window_t provided */
+    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 );
 
 #define THEDP DialogsProvider::getInstance()
 #define THEMIM MainInputManager::getInstance( p_intf )
+#define THEAM ActionsManager::getInstance( p_intf )
 
 #define qfu( i ) QString::fromUtf8( i )
 #define qtr( i ) QString::fromUtf8( vlc_gettext(i) )
 #define qtu( i ) ((i).toUtf8().constData())
 
-#define CONNECT( a, b, c, d ) connect( a, SIGNAL( b ), c, SLOT(d) )
-#define BUTTONACT( b, a ) connect( b, SIGNAL( clicked() ), this, SLOT(a) )
+#define CONNECT( a, b, c, 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) )
 
 #define BUTTON_SET( button, text, tooltip )  \
     button->setText( text );                 \
@@ -116,7 +122,8 @@ struct intf_sys_t
 #define TOGGLEV( x ) { if( x->isVisible() ) x->hide();          \
             else  x->show(); }
 
-#define setLayoutMargins( a, b, c, d, e) setContentsMargins( a, b, c, d )
+/* for widgets which must not follow the RTL auto layout changes */
+#define RTL_UNAFFECTED_WIDGET setLayoutDirection( Qt::LeftToRight );
 
 #define getSettings() p_intf->p_sys->mainSettings
 
@@ -124,10 +131,16 @@ static inline QString QVLCUserDir( vlc_userdir_t type )
 {
     char *dir = config_GetUserDir( type );
     if( !dir )
-        abort();
+        return "";
     QString res = qfu( dir );
     free( dir );
     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