void InternalWindow::detachFromEventProducer(void) { Inherited::detachFromEventProducer(); destroyPopupMenu(); _TitlebarDraggedListener.disconnect(); _BorderDraggedListener.disconnect(); }
void InternalWindow::popupMenuKeyPressed(KeyEventDetails* const e) { if(e->getKey() == KeyEventDetails::KEY_ESCAPE) { destroyPopupMenu(); } else if(e->getKey() == KeyEventDetails::KEY_UP) { getMFActivePopupMenus()->front()->setSelection( getMFActivePopupMenus()->front()->getSelectionIndex() -1 ); } else if(e->getKey() == KeyEventDetails::KEY_DOWN) { getMFActivePopupMenus()->front()->setSelection( getMFActivePopupMenus()->front()->getSelectionIndex() +1 ); } else if(e->getKey() == KeyEventDetails::KEY_ENTER && getMFActivePopupMenus()->front()->getItem(getMFActivePopupMenus()->front()->getSelectionIndex()) != NULL) { getMFActivePopupMenus()->front()->getItem(getMFActivePopupMenus()->front()->getSelectionIndex())->activate(); destroyPopupMenu(); } }
void InternalWindow::popupMenuMousePressed(MouseEventDetails* const e) { for(Int32 i(getMFActivePopupMenus()->size()-1) ; i>=0 ; --i) { bool isContained = getActivePopupMenus(i)->isContained(e->getLocation(), true); checkMouseEnterExit(e,e->getLocation(),getActivePopupMenus(i),isContained,e->getViewport()); if(isContained) { getActivePopupMenus(i)->mousePressed(e); return; } } destroyPopupMenu(); }
void InternalWindow::detachFromEventProducer(void) { Inherited::detachFromEventProducer(); destroyPopupMenu(); _TitleBarMousePressedConnection.disconnect(); _TitlebarDragMouseDraggedConnection.disconnect(); _TitlebarDragMouseReleasedConnection.disconnect(); _TitlebarDragKeyPressedConnection.disconnect(); _BorderDragMouseDraggedConnection.disconnect(); _BorderDragMouseReleasedConnection.disconnect(); _BorderDragKeyPressedConnection.disconnect(); _CloseButtonActionConnection.disconnect(); _MaximizeButtonActionConnection.disconnect(); _IconifyButtonActionConnection.disconnect(); }
MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) { /* Variables initialisation */ bgWidget = NULL; videoWidget = NULL; playlistWidget = NULL; stackCentralOldWidget= NULL; #ifndef HAVE_MAEMO sysTray = NULL; #endif fullscreenControls = NULL; cryptedLabel = NULL; controls = NULL; inputC = NULL; b_hideAfterCreation = false; // --qt-start-minimized playlistVisible = false; input_name = ""; /* Ask for Privacy */ FirstRun::CheckAndRun( this, p_intf ); /** * Configuration and settings * Pre-building of interface **/ /* Main settings */ setFocusPolicy( Qt::StrongFocus ); setAcceptDrops( true ); setWindowRole( "vlc-main" ); setWindowIcon( QApplication::windowIcon() ); setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) ); #ifdef Q_WS_MAC setAttribute( Qt::WA_MacBrushedMetal ); #endif /* Is video in embedded in the UI or not */ b_videoEmbedded = var_InheritBool( p_intf, "embedded-video" ); /* Does the interface resize to video size or the opposite */ b_autoresize = var_InheritBool( p_intf, "qt-video-autoresize" ); /* Are we in the enhanced always-video mode or not ? */ b_minimalView = var_InheritBool( p_intf, "qt-minimal-view" ); /* Do we want anoying popups or not */ b_notificationEnabled = var_InheritBool( p_intf, "qt-notification" ); /* Set the other interface settings */ settings = getSettings(); settings->beginGroup( "MainWindow" ); /* */ b_plDocked = getSettings()->value( "pl-dock-status", true ).toBool(); settings->endGroup( ); /************** * Status Bar * **************/ createStatusBar(); /************************** * UI and Widgets design **************************/ setVLCWindowsTitle(); /************ * Menu Bar * ************/ QVLCMenu::createMenuBar( this, p_intf ); CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ), this, destroyPopupMenu() ); createMainWidget( settings ); /********************************* * Create the Systray Management * *********************************/ initSystray(); /******************** * Input Manager * ********************/ MainInputManager::getInstance( p_intf ); #ifdef WIN32 himl = NULL; p_taskbl = NULL; taskbar_wmsg = RegisterWindowMessage("TaskbarButtonCreated"); #endif /************************************************************ * Connect the input manager to the GUI elements it manages * ************************************************************/ /** * Connects on nameChanged() * Those connects are different because options can impeach them to trigger. **/ /* Main Interface statusbar */ CONNECT( THEMIM->getIM(), nameChanged( const QString& ), this, setName( const QString& ) ); /* and systray */ #ifndef HAVE_MAEMO if( sysTray ) { CONNECT( THEMIM->getIM(), nameChanged( const QString& ), this, updateSystrayTooltipName( const QString& ) ); } #endif /* and title of the Main Interface*/ if( var_InheritBool( p_intf, "qt-name-in-title" ) ) { CONNECT( THEMIM->getIM(), nameChanged( const QString& ), this, setVLCWindowsTitle( const QString& ) ); }
MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) { /* Variables initialisation */ // need_components_update = false; bgWidget = NULL; videoWidget = NULL; playlistWidget = NULL; #ifndef HAVE_MAEMO sysTray = NULL; #endif videoIsActive = false; playlistVisible = false; input_name = ""; fullscreenControls = NULL; cryptedLabel = NULL; controls = NULL; inputC = NULL; b_shouldHide = false; bgWasVisible = false; i_bg_height = 0; /* Ask for privacy */ askForPrivacy(); /** * Configuration and settings * Pre-building of interface **/ /* Main settings */ setFocusPolicy( Qt::StrongFocus ); setAcceptDrops( true ); setWindowRole( "vlc-main" ); setWindowIcon( QApplication::windowIcon() ); setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) ); /* Set The Video In emebedded Mode or not */ videoEmbeddedFlag = config_GetInt( p_intf, "embedded-video" ); /* Does the interface resize to video size or the opposite */ b_keep_size = !config_GetInt( p_intf, "qt-video-autoresize" ); /* Are we in the enhanced always-video mode or not ? */ i_visualmode = config_GetInt( p_intf, "qt-display-mode" ); /* Do we want anoying popups or not */ notificationEnabled = (bool)config_GetInt( p_intf, "qt-notification" ); /* Set the other interface settings */ settings = getSettings(); settings->beginGroup( "MainWindow" ); /** * Retrieve saved sizes for main window * mainBasedSize = based window size for normal mode * (no video, no background) * mainVideoSize = window size with video (all modes) **/ mainBasedSize = settings->value( "mainBasedSize", QSize( 350, 120 ) ).toSize(); mainVideoSize = settings->value( "mainVideoSize", QSize( 400, 300 ) ).toSize(); /************** * Status Bar * **************/ createStatusBar(); /************************** * UI and Widgets design **************************/ setVLCWindowsTitle(); createMainWidget( settings ); /************ * Menu Bar * ************/ QVLCMenu::createMenuBar( this, p_intf ); CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ), this, destroyPopupMenu() ); #if 0 /* Create a Dock to get the playlist */ dockPL = new QDockWidget( qtr( "Playlist" ), this ); dockPL->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); dockPL->setFeatures( QDockWidget::AllDockWidgetFeatures ); dockPL->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea ); dockPL->hide(); #endif /********************************* * Create the Systray Management * *********************************/ initSystray(); /******************** * Input Manager * ********************/ MainInputManager::getInstance( p_intf ); /************************************************************ * Connect the input manager to the GUI elements it manages * ************************************************************/ /** * Connects on nameChanged() * Those connects are different because options can impeach them to trigger. **/ /* Main Interface statusbar */ CONNECT( THEMIM->getIM(), nameChanged( const QString& ), this, setName( const QString& ) ); /* and systray */ #ifndef HAVE_MAEMO if( sysTray ) { CONNECT( THEMIM->getIM(), nameChanged( const QString& ), this, updateSystrayTooltipName( const QString& ) ); } #endif /* and title of the Main Interface*/ if( config_GetInt( p_intf, "qt-name-in-title" ) ) { CONNECT( THEMIM->getIM(), nameChanged( const QString& ), this, setVLCWindowsTitle( const QString& ) ); }