Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

generic_window.hpp

00001 /*****************************************************************************
00002  * generic_window.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: generic_window.hpp 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
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 EvtMotion;
00036 class EvtMouse;
00037 class EvtKey;
00038 class EvtRefresh;
00039 class EvtScroll;
00040 class WindowManager;
00041 
00042 
00044 class GenericWindow: public SkinObject, public Observer<VarBool>
00045 {
00046     private:
00047         friend class WindowManager;
00048     public:
00049         GenericWindow( intf_thread_t *pIntf, int xPos, int yPos,
00050                        bool dragDrop, bool playOnDrop,
00051                        GenericWindow *pParent = NULL );
00052         virtual ~GenericWindow();
00053 
00055         virtual void processEvent( EvtFocus &rEvtFocus ) {}
00056         virtual void processEvent( EvtMotion &rEvtMotion ) {}
00057         virtual void processEvent( EvtMouse &rEvtMouse ) {}
00058         virtual void processEvent( EvtLeave &rEvtLeave ) {}
00059         virtual void processEvent( EvtKey &rEvtKey ) {}
00060         virtual void processEvent( EvtScroll &rEvtScroll ) {}
00061 
00062         virtual void processEvent( EvtRefresh &rEvtRefresh );
00063 
00065         virtual void resize( int width, int height );
00066 
00068         virtual void refresh( int left, int top, int width, int height ) {}
00069 
00071         int getLeft() const { return m_left; }
00072         int getTop() const { return m_top; }
00073         int getWidth() const { return m_width; }
00074         int getHeight() const { return m_height; }
00075 
00077         VarBool &getVisibleVar() { return m_varVisible; }
00078 
00080         virtual string getType() const { return "Generic"; }
00081 
00082     protected:
00084         OSWindow *getOSWindow() const { return m_pOsWindow; }
00085 
00088 
00089 
00090         virtual void show() const;
00091 
00093         virtual void hide() const;
00094 
00096         virtual void move( int left, int top );
00097 
00099         virtual void raise() const;
00100 
00102         virtual void setOpacity( uint8_t value );
00103 
00105         virtual void toggleOnTop( bool onTop ) const;
00107 
00109         virtual void innerShow();
00110 
00112         virtual void innerHide();
00113 
00114     private:
00116         int m_left, m_top, m_width, m_height;
00118         OSWindow *m_pOsWindow;
00120         mutable VarBoolImpl m_varVisible;
00121 
00123         virtual void onUpdate( Subject<VarBool> &rVariable );
00124 };
00125 
00126 
00127 #endif

Generated on Tue Dec 20 10:14:42 2005 for vlc-0.8.4a by  doxygen 1.4.2