X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fmain_interface.hpp;h=48aed59e481819c3a408128f288cf1adc7e170ce;hb=b42755d7fd2a64ad8c9d4c881388685abee9c463;hp=81e2e5bf5fbd2ea4ed9817932d8276e3846bf127;hpb=f6857c6a31f40a49859972e483bfdec57cb8861b;p=vlc diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp index 81e2e5bf5f..48aed59e48 100644 --- a/modules/gui/qt4/main_interface.hpp +++ b/modules/gui/qt4/main_interface.hpp @@ -1,10 +1,11 @@ /***************************************************************************** * main_interface.hpp : Main Interface **************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2006-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac + * Jean-Baptiste Kempf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,17 +19,18 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ + * 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 -#include "ui/main_interface.h" + #include "util/qvlcframe.hpp" +#include "components/preferences_widgets.hpp" /* First Start */ -#include +#include class QSettings; class QCloseEvent; @@ -36,109 +38,153 @@ class QKeyEvent; class QLabel; class QEvent; class InputManager; -class InputSlider; class VideoWidget; class BackgroundWidget; class PlaylistWidget; -class VolumeClickHandler; class VisualSelector; +class AdvControlsWidget; class ControlsWidget; +class InputControlsWidget; +class FullscreenControllerWidget; +class SpeedControlWidget; +class QMenu; +class QSize; +class DialogHandler; + +enum { + CONTROLS_VISIBLE = 0x1, + CONTROLS_HIDDEN = 0x2, + CONTROLS_ADVANCED = 0x4, +}; + +typedef enum pl_dock_e { + PL_UNDOCKED, + PL_BOTTOM, + PL_RIGHT, + PL_LEFT +} pl_dock_e; class MainInterface : public QVLCMW { Q_OBJECT; + + friend class PlaylistWidget; + public: MainInterface( intf_thread_t *); virtual ~MainInterface(); - void *requestVideo( vout_thread_t *p_nvout, int *pi_x, - int *pi_y, unsigned int *pi_width, - unsigned int *pi_height ); - void releaseVideo( void *); - int controlVideo( void *p_window, int i_query, va_list args ); + + /* 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 ); + void releaseVideo( void ); + int controlVideo( int i_query, va_list args ); + + /* Getters */ + QSystemTrayIcon *getSysTray() { return sysTray; }; + QMenu *getSysTrayMenu() { return systrayMenu; }; + int getControlsVisibilityStatus(); + + /* Sizehint() */ + virtual QSize sizeHint() const; + protected: - void resizeEvent( QResizeEvent * ); +// void resizeEvent( QResizeEvent * ); void dropEvent( QDropEvent *); + void dropEventPlay( QDropEvent *, bool); void dragEnterEvent( QDragEnterEvent * ); void dragMoveEvent( QDragMoveEvent * ); void dragLeaveEvent( QDragLeaveEvent * ); void closeEvent( QCloseEvent *); - Ui::MainInterfaceUI ui; - friend class VolumeClickHandler; + private: - QSettings *settings; - QSize mainSize, addSize; + QSettings *settings; + QSystemTrayIcon *sysTray; + QMenu *systrayMenu; + QString input_name; + QVBoxLayout *mainLayout; + ControlsWidget *controls; + InputControlsWidget *inputC; + FullscreenControllerWidget *fullscreenControls; + DialogHandler *dialogHandler; - bool need_components_update; - void calculateInterfaceSize(); void handleMainUi( QSettings* ); - void doComponentsUpdate(); + void askForPrivacy(); + int privacyDialog( QList *controls ); - /* Video */ - VideoWidget *videoWidget; - virtual void keyPressEvent( QKeyEvent *); - virtual void wheelEvent( QWheelEvent * ); + /* Systray */ + void handleSystray(); + void createSystray(); + void initSystray(); - bool embeddedPlaylistWasActive; - bool videoIsActive; - QSize savedVideoSize; + void createStatusBar(); + /* Video */ + VideoWidget *videoWidget; BackgroundWidget *bgWidget; VisualSelector *visualSelector; - ControlsWidget *advControls; PlaylistWidget *playlistWidget; - bool playlistEmbeddedFlag; - bool videoEmbeddedFlag; - bool alwaysVideoFlag; - bool advControlsEnabled; + bool videoIsActive; ///< Having a video now / THEMIM->hasV + bool videoEmbeddedFlag; ///< Want an external Video Window + bool playlistVisible; ///< Is the playlist visible ? bool visualSelectorEnabled; - - InputManager *main_input_manager; - InputSlider *slider; - input_thread_t *p_input; ///< Main input associated to the playlist - - QLabel *timeLabel; + 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 ); } + + /* Status Bar */ QLabel *nameLabel; + QLabel *cryptedLabel; + + virtual void customEvent( QEvent *); + virtual void keyPressEvent( QKeyEvent *); + virtual void wheelEvent( QWheelEvent * ); + virtual void resizeEvent( QResizeEvent * event ); - void customEvent( QEvent *); public slots: void undockPlaylist(); + void dockPlaylist( pl_dock_e i_pos = PL_BOTTOM ); + void toggleMinimalView( bool ); + void togglePlaylist(); + void toggleUpdateSystrayMenu(); + void toggleAdvanced(); + void toggleFullScreen(); + void toggleFSC(); + void popupMenu(); + + /* Manage the Video Functions from the vout threads */ + void releaseVideoSlot( void ); + private slots: - void setNavigation( int ); - void setStatus( int ); + void debug(); + void doComponentsUpdate(); void setName( QString ); - void setDisplay( float, int, int ); - void updateOnTimer(); - void play(); - void stop(); - void prev(); - void next(); - void playlist(); + void setVLCWindowsTitle( QString title = "" ); +#if 0 void visual(); - void advanced(); - void updateVolume( int sliderVolume ); -}; - - -class VolumeClickHandler : public QObject -{ -public: - VolumeClickHandler( intf_thread_t *_p_intf, MainInterface *_m ) :QObject(_m) - {m = _m; p_intf = _p_intf; } - virtual ~VolumeClickHandler() {}; - bool eventFilter( QObject *obj, QEvent *e ) - { - if (e->type() == QEvent::MouseButtonPress ) - { - aout_VolumeMute( p_intf, NULL ); - return true; - } - return false; - } -private: - MainInterface *m; - intf_thread_t *p_intf; +#endif + void handleSystrayClick( QSystemTrayIcon::ActivationReason ); + void updateSystrayTooltipName( QString ); + void updateSystrayTooltipStatus( int ); + + void showCryptedLabel( bool ); +signals: + void askReleaseVideo( ); + void askVideoToResize( unsigned int, unsigned int ); + void askVideoToShow( unsigned int, unsigned int ); + void askVideoToToggle(); + void askBgWidgetToToggle(); + void askUpdate(); + void minimalViewToggled( bool ); + void fullscreenInterfaceToggled( bool ); }; #endif