generic_window.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GENERIC_WINDOW_HPP
00026 #define GENERIC_WINDOW_HPP
00027
00028 #include "skin_common.hpp"
00029 #include "../utils/var_bool.hpp"
00030
00031 class OSWindow;
00032 class EvtGeneric;
00033 class EvtFocus;
00034 class EvtLeave;
00035 class EvtMenu;
00036 class EvtMotion;
00037 class EvtMouse;
00038 class EvtKey;
00039 class EvtRefresh;
00040 class EvtScroll;
00041 class WindowManager;
00042
00043
00044
00045 class GenericWindow: public SkinObject, public Observer<VarBool>
00046 {
00047 private:
00048 friend class WindowManager;
00049 friend class VoutManager;
00050 friend class CtrlVideo;
00051 public:
00052
00053 enum WindowType_t
00054 {
00055 TopWindow,
00056 VoutWindow,
00057 FullscreenWindow,
00058 };
00059
00060 GenericWindow( intf_thread_t *pIntf, int xPos, int yPos,
00061 bool dragDrop, bool playOnDrop,
00062 GenericWindow *pParent = NULL,
00063 WindowType_t type = TopWindow );
00064 virtual ~GenericWindow();
00065
00066
00067 virtual void processEvent( EvtFocus &rEvtFocus ) { }
00068 virtual void processEvent( EvtMenu &rEvtMenu ) { }
00069 virtual void processEvent( EvtMotion &rEvtMotion ) { }
00070 virtual void processEvent( EvtMouse &rEvtMouse ) { }
00071 virtual void processEvent( EvtLeave &rEvtLeave ) { }
00072 virtual void processEvent( EvtKey &rEvtKey ) { }
00073 virtual void processEvent( EvtScroll &rEvtScroll ) { }
00074
00075 virtual void processEvent( EvtRefresh &rEvtRefresh );
00076
00077
00078 virtual void resize( int width, int height );
00079
00080
00081 virtual void refresh( int left, int top, int width, int height ) { }
00082
00083
00084 int getLeft() const { return m_left; }
00085 int getTop() const { return m_top; }
00086 int getWidth() const { return m_width; }
00087 int getHeight() const { return m_height; }
00088
00089
00090 VarBool &getVisibleVar() { return *m_pVarVisible; }
00091
00092
00093 virtual string getType() const { return "Generic"; }
00094
00095
00096 void* getOSHandle() const;
00097
00098
00099 void setParent( GenericWindow* pParent,
00100 int x = 0, int y = 0, int w = -1, int h = -1 );
00101
00102 protected:
00103
00104 OSWindow *getOSWindow() const { return m_pOsWindow; }
00105
00106
00107
00108
00109
00110 virtual void show() const;
00111
00112
00113 virtual void hide() const;
00114
00115
00116 virtual void move( int left, int top );
00117
00118
00119 virtual void raise() const;
00120
00121
00122 virtual void setOpacity( uint8_t value );
00123
00124
00125 virtual void toggleOnTop( bool onTop ) const;
00126
00127
00128
00129 virtual void innerShow();
00130
00131
00132 virtual void innerHide();
00133
00134 private:
00135
00136 int m_left, m_top, m_width, m_height;
00137
00138 OSWindow *m_pOsWindow;
00139
00140 mutable VarBoolImpl *m_pVarVisible;
00141
00142
00143 virtual void onUpdate( Subject<VarBool> &rVariable , void*);
00144 };
00145
00146
00147 #endif