x11_window.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * x11_window.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: 58be247891b144b20a7b5a55c7ba66db1cf8324e $
00006  *
00007  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
00008  *          Olivier Teulière <ipkiss@via.ecp.fr>
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 along
00021  * with this program; if not, write to the Free Software Foundation, Inc.,
00022  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef X11_WINDOW_HPP
00026 #define X11_WINDOW_HPP
00027 
00028 #include <X11/Xlib.h>
00029 #include <X11/Xatom.h>
00030 
00031 #include "../src/generic_window.hpp"
00032 #include "../src/os_window.hpp"
00033 
00034 class X11Display;
00035 class X11DragDrop;
00036 
00037 
00038 /// X11 implementation of OSWindow
00039 class X11Window: public OSWindow
00040 {
00041 public:
00042     X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
00043                X11Display &rDisplay, bool dragDrop, bool playOnDrop,
00044                X11Window *pParentWindow, GenericWindow::WindowType_t );
00045 
00046     virtual ~X11Window();
00047 
00048     // Show the window
00049     virtual void show() const;
00050 
00051     // Hide the window
00052     virtual void hide() const;
00053 
00054     /// Move the window
00055     virtual void moveResize( int left, int top,
00056                              int width, int height ) const;
00057 
00058     /// Bring the window on top
00059     virtual void raise() const;
00060 
00061     /// Set the opacity of the window (0 = transparent, 255 = opaque)
00062     virtual void setOpacity( uint8_t value ) const;
00063 
00064     /// Toggle the window on top
00065     virtual void toggleOnTop( bool onTop ) const;
00066 
00067     /// Get the window ID
00068     Window getDrawable() const { return m_wnd; }
00069 
00070     /// Getter for the handler
00071     void* getOSHandle() const { return (void*) m_wnd; }
00072 
00073     /// Getter for the handler
00074     void* getParentOSHandle() const { return (void*) m_wnd_parent; }
00075 
00076     /// reparent the window
00077     void reparent( void* OSHandle, int x, int y, int w, int h );
00078 
00079     void setFullscreen() const;
00080 
00081 private:
00082     /// X11 display
00083     X11Display &m_rDisplay;
00084     /// Window ID
00085     Window m_wnd;
00086     /// Window ID
00087     Window m_wnd_parent;
00088     /// Parent window
00089     X11Window *m_pParent;
00090     /// Indicates whether the window handles drag&drop events
00091     bool m_dragDrop;
00092     /// Drop target
00093     X11DragDrop *m_pDropTarget;
00094     /// window type
00095     GenericWindow::WindowType_t m_type;
00096 };
00097 
00098 
00099 #endif

Generated on Tue May 25 08:04:58 2010 for VLC by  doxygen 1.5.6