1 /***************************************************************************** 2 * x11_window.hpp 3 ***************************************************************************** 4 * Copyright (C) 2003 the VideoLAN team 5 * $Id: c8ffa96e490d19f3ac15d58daf4b941ccef88c43 $ 6 * 7 * Authors: Cyril Deguet <asmax@via.ecp.fr> 8 * Olivier Teulière <ipkiss@via.ecp.fr> 9 * 10 * This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by 12 * the Free Software Foundation; either version 2 of the License, or 13 * (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License along 21 * with this program; if not, write to the Free Software Foundation, Inc., 22 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 23 *****************************************************************************/ 24 25 #ifndef X11_WINDOW_HPP 26 #define X11_WINDOW_HPP 27 28 #include <X11/Xlib.h> 29 #include <X11/Xatom.h> 30 31 #include "../src/generic_window.hpp" 32 #include "../src/os_window.hpp" 33 34 class X11Display; 35 class X11DragDrop; 36 37 38 /// X11 implementation of OSWindow 39 class X11Window: public OSWindow 40 { 41 public: 42 X11Window( intf_thread_t *pIntf, GenericWindow &rWindow, 43 X11Display &rDisplay, bool dragDrop, bool playOnDrop, 44 X11Window *pParentWindow, GenericWindow::WindowType_t ); 45 46 virtual ~X11Window(); 47 48 // Show the window 49 virtual void show() const; 50 51 // Hide the window 52 virtual void hide() const; 53 54 /// Move the window 55 virtual void moveResize( int left, int top, 56 int width, int height ) const; 57 58 /// Bring the window on top 59 virtual void raise() const; 60 61 /// Set the opacity of the window (0 = transparent, 255 = opaque) 62 virtual void setOpacity( uint8_t value ) const; 63 64 /// Toggle the window on top 65 virtual void toggleOnTop( bool onTop ) const; 66 67 /// Get the window ID getDrawable() const68 Window getDrawable() const { return m_wnd; } 69 70 /// Getter for the handler getOSHandle() const71 uint32_t getOSHandle() const { return m_wnd; } 72 73 /// Getter for the handler getParentOSHandle() const74 uint32_t getParentOSHandle() const { return m_wnd_parent; } 75 76 /// reparent the window 77 void reparent( uint32_t OSHandle, int x, int y, int w, int h ); 78 79 /// invalidate a window surface 80 bool invalidateRect( int x, int y, int w, int h ) const; 81 82 void setFullscreen() const; 83 84 private: 85 /// X11 display 86 X11Display &m_rDisplay; 87 /// Window ID 88 Window m_wnd; 89 /// Window ID 90 Window m_wnd_parent; 91 /// Parent window 92 X11Window *m_pParent; 93 /// Indicates whether the window handles drag&drop events 94 bool m_dragDrop; 95 /// Drop target 96 X11DragDrop *m_pDropTarget; 97 /// window type 98 GenericWindow::WindowType_t m_type; 99 }; 100 101 102 #endif 103