/// Get the text of the tooltip
virtual UString getTooltipText() const { return m_tooltip; }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "button"; }
+
private:
/// Finite state machine of the control
FSM m_fsm;
* ctrl_checkbox.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: ctrl_checkbox.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
/// Get the text of the tooltip XXX
virtual UString getTooltipText() const { return *m_pTooltip; }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "checkbox"; }
+
private:
/// Finite state machine of the control
FSM m_fsm;
/// Return true if the control is visible
virtual bool isVisible() const;
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return ""; }
+
protected:
// If pVisible is NULL, the control is always visible
CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
* ctrl_image.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: ctrl_image.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "image"; }
+
private:
/// Bitmap
const GenericBitmap &m_rBitmap;
/// Return true if the control can gain the focus
virtual bool isFocusable() const { return true; }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "list"; }
+
private:
/// List associated to the control
VarList &m_rList;
static void transStillMoving( SkinObject *pCtrl );
static void transMovingStill( SkinObject *pCtrl );
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return m_rCtrl.getType(); }
+
private:
FSM m_fsm;
/// Window manager
* ctrl_radialslider.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: ctrl_radialslider.hpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "radial_slider"; }
+
private:
/// Finite state machine of the control
FSM m_fsm;
static void transResizeStill( SkinObject *pCtrl );
static void transResizeResize( SkinObject *pCtrl );
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return m_rCtrl.getType(); }
+
private:
FSM m_fsm;
/// Decorated CtrlFlat
* ctrl_slider.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: ctrl_slider.hpp,v 1.4 2004/03/02 21:45:15 ipkiss Exp $
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
/// Get the text of the tooltip
virtual UString getTooltipText() const { return m_tooltip; }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "slider_cursor"; }
+
private:
/// Finite state machine of the control
FSM m_fsm;
/// Handle an event
virtual void handleEvent( EvtGeneric &rEvent );
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "slider_bg"; }
+
private:
/// Cursor of the slider
CtrlSliderCursor &m_rCursor;
* ctrl_text.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: ctrl_text.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
/// This takes effect immediatly
void setText( const UString &rText, uint32_t color = 0xFFFFFFFF );
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "text"; }
+
private:
/// Finite state machine of the control
FSM m_fsm;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "video"; }
+
private:
/// Vout window
VoutWindow *m_pVout;
{
// Draw all the controls of the layout
list<LayeredControl>::const_iterator iter;
+ list<LayeredControl>::const_iterator iterVideo = m_controlList.end();
for( iter = m_controlList.begin(); iter != m_controlList.end(); iter++ )
{
CtrlGeneric *pCtrl = (*iter).m_pControl;
if( pCtrl->isVisible() && pPos )
{
pCtrl->draw( *m_pImage, pPos->getLeft(), pPos->getTop() );
+ // Remember the video control (we assume there is at most one video
+ // control per layout)
+ if( pCtrl->getType() == "video" && pCtrl->getPosition() )
+ iterVideo = iter;
}
}
if( y + height > m_height )
height = m_height - y;
- pWindow->refresh( x, y, width, height );
+ // Refresh the window... but do not paint on a video control!
+ if( iterVideo == m_controlList.end() )
+ {
+ // No video control, we can safely repain the rectangle
+ pWindow->refresh( x, y, width, height );
+ }
+ else
+ {
+ // Bad luck, there is a video control somewhere (not necessarily
+ // in the repainting zone, btw).
+ // We will divide the repainting into 4 regions (top, left, bottom
+ // and right). The overlapping parts (i.e. the corners) of these
+ // regions will be painted twice, because otherwise the algorithm
+ // becomes a real mess :)
+
+ // Use short variable names for convenience
+ int xx = iterVideo->m_pControl->getPosition()->getLeft();
+ int yy = iterVideo->m_pControl->getPosition()->getTop();
+ int ww = iterVideo->m_pControl->getPosition()->getWidth();
+ int hh = iterVideo->m_pControl->getPosition()->getHeight();
+
+ // Top part:
+ if( y < yy )
+ pWindow->refresh( x, y, width, yy - y );
+ // Left part:
+ if( x < xx )
+ pWindow->refresh( x, y, xx - x, height );
+ // Bottom part
+ if( y + height > yy + hh )
+ pWindow->refresh( x, yy + hh, width, y + height - (yy + hh) );
+ // Right part
+ if( x + width > xx + ww )
+ pWindow->refresh( xx + ww, y, x + width - (xx + ww), height );
+ }
}
}
/// Refresh the window
virtual void refreshAll();
+ /// Refresh a rectangular portion of the window
+ virtual void refreshRect( int x, int y, int width, int height );
+
/// Get the image of the layout
virtual OSGraphics *getImage() const { return m_pImage; }
virtual void addAnchor( Anchor *pAnchor );
private:
- /// Refresh a rectangular portion of the window
- void GenericLayout::refreshRect( int x, int y, int width, int height );
-
/// Parent window of the layout
TopWindow *m_pWindow;
/// Layout size
#include "../commands/cmd_on_top.hpp"
#include "../commands/cmd_dialogs.hpp"
#include "../controls/ctrl_generic.hpp"
+#include "../events/evt_refresh.hpp"
#include "../events/evt_enter.hpp"
#include "../events/evt_focus.hpp"
#include "../events/evt_leave.hpp"
}
+void TopWindow::processEvent( EvtRefresh &rEvtRefresh )
+{
+ // We override the behaviour defined in GenericWindow, because we don't
+ // want to draw on a video control!
+ if( m_pActiveLayout == NULL )
+ {
+ GenericWindow::processEvent( rEvtRefresh );
+ }
+ else
+ {
+ m_pActiveLayout->refreshRect( rEvtRefresh.getXStart(),
+ rEvtRefresh.getYStart(),
+ rEvtRefresh.getWidth(),
+ rEvtRefresh.getHeight() );
+ }
+}
+
+
void TopWindow::processEvent( EvtFocus &rEvtFocus )
{
// fprintf(stderr, rEvtFocus.getAsString().c_str()) ;
virtual ~TopWindow();
/// Methods to process OS events.
+ virtual void processEvent( EvtRefresh &rEvtRefresh );
virtual void processEvent( EvtFocus &rEvtFocus );
virtual void processEvent( EvtMotion &rEvtMotion );
virtual void processEvent( EvtMouse &rEvtMouse );
/// Set the vout window handle
void setVoutWindow( void *pVoutWindow );
+ /// Indicate whether the embedded video output is currently used
+ bool isVoutUsed() const { return m_pVout; }
+
protected:
// Protected because it is a singleton
VlcProc( intf_thread_t *pIntf );
VariablePtr m_cVarStopped;
VariablePtr m_cVarPaused;
VariablePtr m_cVarSeekable;
- /// Vout window hanlde
+ /// Vout window handle
void *m_pVoutWindow;
/// Vout thread
vout_thread_t *m_pVout;
*****************************************************************************/
#include "vout_window.hpp"
+#include "vlcproc.hpp"
#include "os_factory.hpp"
#include "os_graphics.hpp"
#include "os_window.hpp"
{
if( m_pImage )
{
- m_pImage->copyToWindow( *getOSWindow(), left, top, width, height, left,
- top );
+ // Get the VlcProc
+ VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
+
+ // Refresh only when there is no video!
+ if( pVlcProc && !pVlcProc->isVoutUsed() )
+ {
+ m_pImage->copyToWindow( *getOSWindow(), left, top,
+ width, height, left, top );
+ }
}
}
Infos.rcPaint.right - Infos.rcPaint.left + 1,
Infos.rcPaint.bottom - Infos.rcPaint.top + 1 );
EndPaint( msg.hwnd, &Infos );
- // Ignore all the painting events for the vout window,
- // otherwise we are going to screw up the colorkey
- if( win.getType() != "Vout" )
- {
- win.processEvent( evt );
- }
+ win.processEvent( evt );
break;
}
case WM_MOUSEMOVE: