X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fqt4.hpp;h=b764a9c4f3ef4afd2b548e1c5bb9b9a4e15c31a8;hb=7d5bf1ea1baaaad1dbd494312b725e18b00c1de9;hp=560c30586077427a4606bf5a61015dcb49100305;hpb=d1b3841be789cf54ffd2b72c8cc6c860f70844cb;p=vlc diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp index 560c305860..b764a9c4f3 100644 --- a/modules/gui/qt4/qt4.hpp +++ b/modules/gui/qt4/qt4.hpp @@ -22,8 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#ifndef _QVLC_H_ -#define _QVLC_H_ +#ifndef QVLC_H_ +#define QVLC_H_ #ifdef HAVE_CONFIG_H # include "config.h" @@ -34,6 +34,7 @@ #include /* playlist_t */ #include +#include #if ( QT_VERSION < 0x040300 ) # error Update your Qt version @@ -48,52 +49,45 @@ enum { enum { DialogEventType = 0, IMEventType = 100, - PLEventType = 200 -}; - -enum { - DialogEvent_Type = QEvent::User + DialogEventType + 1, - //PLUndockEvent_Type = QEvent::User + DialogEventType + 2; - //PLDockEvent_Type = QEvent::User + DialogEventType + 3; - SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4, + PLEventType = 200, + MsgEventType = 300, }; -class QApplication; +class QVLCApp; class QMenu; class MainInterface; -class DialogsProvider; -class VideoWidget; class QSettings; struct intf_sys_t { vlc_thread_t thread; - QApplication *p_app; /* Main Qt Application */ + 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 */ - const char *psz_filepath; /* Last path used in dialogs */ + QString filepath; /* Last path used in dialogs */ QMenu * p_popup_menu; /* The right click menu */ }; #define THEPL p_intf->p_sys->p_playlist -#define QPL_LOCK vlc_object_lock( THEPL ); -#define QPL_UNLOCK vlc_object_unlock( THEPL ); +#define QPL_LOCK playlist_Lock( THEPL ); +#define QPL_UNLOCK playlist_Unlock( THEPL ); #define THEDP DialogsProvider::getInstance() #define THEMIM MainInputManager::getInstance( p_intf ) #define qfu( i ) QString::fromUtf8( i ) -#define qtr( i ) QString::fromUtf8( _(i) ) -#define qtu( i ) (i).toUtf8().data() -#define qta( i ) (i).toAscii().data() +#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) ) @@ -124,27 +118,4 @@ struct intf_sys_t #define getSettings() p_intf->p_sys->mainSettings -#include -/* Replace separators on Windows because Qt is always using / */ -static inline QString toNativeSeparators( QString s ) -{ -#ifdef WIN32 - for (int i=0; i<(int)s.length(); i++) - { - if (s[i] == QLatin1Char('/')) - s[i] = QLatin1Char('\\'); - } -#endif - return s; -} - -static inline QString removeTrailingSlash( QString s ) -{ - if( ( s.length() > 1 ) && ( s[s.length()-1] == QLatin1Char( '/' ) ) ) - s.remove( s.length() - 1, 1 ); - return s; -} - -#define toNativeSepNoSlash( a ) toNativeSeparators( removeTrailingSlash( a ) ) - #endif