]> git.sesse.net Git - vlc/blob - modules/gui/skins2/controls/ctrl_video.hpp
* all: new handling of vout controls to allow serveral layouts/windows
[vlc] / modules / gui / skins2 / controls / ctrl_video.hpp
1 /*****************************************************************************
2  * ctrl_video.hpp
3  *****************************************************************************
4  * Copyright (C) 2004 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef CTRL_VIDEO_HPP
25 #define CTRL_VIDEO_HPP
26
27 #include "ctrl_generic.hpp"
28 #include "../utils/position.hpp"
29
30 class VoutWindow;
31
32 /// Control video
33 class CtrlVideo: public CtrlGeneric, public Observer<VarBox, void*>
34 {
35     public:
36         CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout,
37                    bool autoResize, const UString &rHelp, VarBool *pVisible );
38         virtual ~CtrlVideo();
39
40         /// Handle an event on the control
41         virtual void handleEvent( EvtGeneric &rEvent );
42
43         /// Check whether coordinates are inside the control
44         virtual bool mouseOver( int x, int y ) const;
45
46         /// Callback for layout resize
47         virtual void onResize();
48
49         /// Called when the Position is set
50         virtual void onPositionChange();
51
52         /// Draw the control on the given graphics
53         virtual void draw( OSGraphics &rImage, int xDest, int yDest );
54
55         /// Get the type of control (custom RTTI)
56         virtual string getType() const { return "video"; }
57
58         /// Method called when the vout size is updated
59         virtual void onUpdate( Subject<VarBox,void*> &rVoutSize, void* );
60
61         /// Called by the layout when the control is show/hidden
62         void setVisible( bool visible );
63
64     private:
65         /// Vout window
66         VoutWindow *m_pVout;
67         /// Associated layout
68         GenericLayout &m_rLayout;
69         /// Difference between layout size and video size
70         int m_xShift, m_yShift;
71 };
72
73 #endif