void TopWindow::processEvent( EvtScroll &rEvtScroll ) { // Raise the windows raise(); // Get the control hit by the mouse CtrlGeneric *pNewHitControl = findHitControl( rEvtScroll.getXPos(), rEvtScroll.getYPos()); setLastHit( pNewHitControl ); // send a mouse event to the right control when scrollable // if none, send it directly to the vlc core CtrlGeneric *pHitControl = m_pCapturingControl ? m_pCapturingControl : pNewHitControl; if( pHitControl && pHitControl->isScrollable() ) { pHitControl->handleEvent( rEvtScroll ); } else { // Treat the scroll event as a hotkey plus current modifiers int i = (rEvtScroll.getDirection() == EvtScroll::kUp ? KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN) | m_currModifier; var_SetInteger( getIntf()->p_libvlc, "key-pressed", i ); } }
void TopWindow::processEvent( EvtMotion &rEvtMotion ) { // New control hit by the mouse CtrlGeneric *pNewHitControl = findHitControl( rEvtMotion.getXPos() - getLeft(), rEvtMotion.getYPos() - getTop() ); setLastHit( pNewHitControl ); /// Update the help text VarManager *pVarManager = VarManager::instance( getIntf() ); if( pNewHitControl ) { pVarManager->getHelpText().set( pNewHitControl->getHelpText() ); } // Send a motion event to the hit control, or to the control // that captured the mouse, if any CtrlGeneric *pActiveControl = pNewHitControl; if( m_pCapturingControl ) { pActiveControl = m_pCapturingControl; } if( pActiveControl ) { // Compute the coordinates relative to the window int xPos = rEvtMotion.getXPos() - getLeft(); int yPos = rEvtMotion.getYPos() - getTop(); // Send a motion event EvtMotion evt( getIntf(), xPos, yPos ); pActiveControl->handleEvent( evt ); } }
void TopWindow::processEvent( EvtScroll &rEvtScroll ) { // Raise the windows raise(); // Get the control hit by the mouse CtrlGeneric *pNewHitControl = findHitControl( rEvtScroll.getXPos(), rEvtScroll.getYPos()); setLastHit( pNewHitControl ); // Send a mouse event to the hit control, or to the control // that captured the mouse, if any CtrlGeneric *pActiveControl = pNewHitControl; if( m_pCapturingControl ) { pActiveControl = m_pCapturingControl; } if( pActiveControl ) { pActiveControl->handleEvent( rEvtScroll ); } else { // Treat the scroll event as a hotkey plus current modifiers int i = (rEvtScroll.getDirection() == EvtScroll::kUp ? KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN) | m_currModifier; var_SetInteger( getIntf()->p_libvlc, "key-pressed", i ); } }
void TopWindow::processEvent( EvtLeave &rEvtLeave ) { // No more hit control setLastHit( NULL ); if( !m_pCapturingControl ) { m_rWindowManager.hideTooltip(); } }
Model::RotateHandleHit* RotateHandle::pick(const Rayf& ray) { Vec3f xAxis, yAxis, zAxis; axes(ray.origin, xAxis, yAxis, zAxis); Model::RotateHandleHit* closestHit = NULL; closestHit = selectHit(closestHit, pickRing(ray, xAxis, yAxis, zAxis, Model::RotateHandleHit::HAXAxis)); closestHit = selectHit(closestHit, pickRing(ray, yAxis, xAxis, zAxis, Model::RotateHandleHit::HAYAxis)); closestHit = selectHit(closestHit, pickRing(ray, zAxis, xAxis, yAxis, Model::RotateHandleHit::HAZAxis)); if (!locked()) setLastHit(closestHit); return closestHit; }
void TopWindow::processEvent( EvtMouse &rEvtMouse ) { // Get the control hit by the mouse CtrlGeneric *pNewHitControl = findHitControl( rEvtMouse.getXPos(), rEvtMouse.getYPos() ); setLastHit( pNewHitControl ); // Change the focused control if( rEvtMouse.getAction() == EvtMouse::kDown ) { // Raise the window m_rWindowManager.raise( *this ); if( pNewHitControl && pNewHitControl->isFocusable() ) { // If a new control gains the focus, the previous one loses it if( m_pFocusControl && m_pFocusControl != pNewHitControl ) { EvtFocus evt( getIntf(), false ); m_pFocusControl->handleEvent( evt ); } if( pNewHitControl != m_pFocusControl ) { m_pFocusControl = pNewHitControl; EvtFocus evt( getIntf(), false ); pNewHitControl->handleEvent( evt ); } } else if( m_pFocusControl ) { // The previous control loses the focus EvtFocus evt( getIntf(), false ); m_pFocusControl->handleEvent( evt ); m_pFocusControl = NULL; } } // Send a mouse event to the hit control, or to the control // that captured the mouse, if any CtrlGeneric *pActiveControl = pNewHitControl; if( m_pCapturingControl ) { pActiveControl = m_pCapturingControl; } if( pActiveControl ) { pActiveControl->handleEvent( rEvtMouse ); } }
void TopWindow::processEvent( EvtScroll &rEvtScroll ) { // Raise the windows raise(); // Get the control hit by the mouse CtrlGeneric *pNewHitControl = findHitControl( rEvtScroll.getXPos(), rEvtScroll.getYPos()); setLastHit( pNewHitControl ); // Send a mouse event to the hit control, or to the control // that captured the mouse, if any CtrlGeneric *pActiveControl = pNewHitControl; if( m_pCapturingControl ) { pActiveControl = m_pCapturingControl; } if( pActiveControl ) { pActiveControl->handleEvent( rEvtScroll ); } else { // Treat the scroll event as a hotkey vlc_value_t val; if( rEvtScroll.getDirection() == EvtScroll::kUp ) { val.i_int = KEY_MOUSEWHEELUP; } else { val.i_int = KEY_MOUSEWHEELDOWN; } // Add the modifiers val.i_int |= m_currModifier; var_Set( getIntf()->p_vlc, "key-pressed", val ); } }