vlc_linux/vlc-3.0.16/modules/gui/qt/components/controller.cpp
/**
 * Mouse change callback (show/hide the controller on mouse movement)
 */
Mouse change callback (show/hide the controller on mouse movement)
Mouse change callback ( show / hide the controller on mouse movement )
void FullscreenControllerWidget::mouseChanged( vout_thread_t *, int i_mousex, int i_mousey )
{
    bool b_toShow;
    b_toShow = false;
    if( ( i_mouse_last_move_x == -1 || i_mouse_last_move_y == -1 ) ||
        ( abs( i_mouse_last_move_x - i_mousex ) > i_sensitivity ||
          abs( i_mouse_last_move_y - i_mousey ) > i_sensitivity ) )
    {
        i_mouse_last_move_x = i_mousex;
        i_mouse_last_move_y = i_mousey;
        b_toShow = true;
    }
    if( b_toShow )
    {
        IMEvent *eShow = new IMEvent( IMEvent::FullscreenControlShow, 0 );
        QApplication::postEvent( this, eShow );
        IMEvent *eHide = new IMEvent( IMEvent::FullscreenControlPlanHide, 0 );
        QApplication::postEvent( this, eHide );
    }
}
void FullscreenControllerWidget :: mouseChanged ( vout_thread_t * , int i_mousex , int i_mousey ) { bool b_toShow ; b_toShow = false ; if ( ( i_mouse_last_move_x == -1 || i_mouse_last_move_y == -1 ) || ( abs ( i_mouse_last_move_x - i_mousex ) > i_sensitivity || abs ( i_mouse_last_move_y - i_mousey ) > i_sensitivity ) ) { i_mouse_last_move_x = i_mousex ; i_mouse_last_move_y = i_mousey ; b_toShow = true ; } if ( b_toShow ) { IMEvent * eShow = new IMEvent ( IMEvent :: FullscreenControlShow , 0 ) ; QApplication :: postEvent ( this , eShow ) ; IMEvent * eHide = new IMEvent ( IMEvent :: FullscreenControlPlanHide , 0 ) ; QApplication :: postEvent ( this , eHide ) ; } }
Mouse change callback (show/hide the controller on mouse movement)
Mouse change callback ( show / hide the controller on mouse movement )
/* FIXME - multiple vout (ie multiple mouse position ?) and thread safety if multiple vout ? */ /* Show event */ /* Plan hide event */