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

x11_display.hpp

00001 /*****************************************************************************
00002  * x11_display.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: x11_display.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 X11_DISPLAY_HPP
00026 #define X11_DISPLAY_HPP
00027 
00028 #include <X11/Xlib.h>
00029 
00030 #include "../src/skin_common.hpp"
00031 
00032 // Helper macros
00033 #define XDISPLAY m_rDisplay.getDisplay()
00034 #define XVISUAL m_rDisplay.getVisual()
00035 #define XPIXELSIZE m_rDisplay.getPixelSize()
00036 #define XGC m_rDisplay.getGC()
00037 
00038 
00040 class X11Display: public SkinObject
00041 {
00042     public:
00043         X11Display( intf_thread_t *pIntf );
00044         virtual ~X11Display();
00045 
00047         Display *getDisplay() const { return m_pDisplay; }
00048 
00050         Visual *getVisual() const { return m_pVisual; }
00051 
00053         int getPixelSize() const { return m_pixelSize; }
00054 
00056         GC getGC() const { return m_gc; }
00057 
00059         Colormap getColormap() const { return m_colormap; }
00060 
00062         typedef void (X11Display::*MakePixelFunc_t)( uint8_t *pPixel,
00063             uint8_t r, uint8_t g, uint8_t b, uint8_t a ) const;
00064 
00066         MakePixelFunc_t getBlendPixel() const { return blendPixelImpl; }
00067 
00069         MakePixelFunc_t getPutPixel() const { return putPixelImpl; }
00070 
00072         unsigned long getPixelValue( uint8_t r, uint8_t g, uint8_t b ) const;
00073 
00075         Window getMainWindow() const { return m_mainWindow; }
00076 
00077         //XXX
00078         Window m_voutWindow;
00079 
00080     private:
00082         Window m_mainWindow;
00084         Display *m_pDisplay;
00085         Visual *m_pVisual;
00086         int m_pixelSize;
00087         GC m_gc;
00088         Colormap m_colormap;
00089         int m_redLeftShift, m_redRightShift;
00090         int m_greenLeftShift, m_greenRightShift;
00091         int m_blueLeftShift, m_blueRightShift;
00093         MakePixelFunc_t blendPixelImpl;
00095         MakePixelFunc_t putPixelImpl;
00096 
00098         void getShifts( uint32_t mask, int &rLeftShift,
00099                         int &rRightShift ) const;
00100 
00102         void blendPixel8( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00103                           uint8_t a ) const;
00104 
00106         void blendPixel16MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00107                               uint8_t a ) const;
00108 
00110         void blendPixel16LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00111                               uint8_t a ) const;
00112 
00114         void blendPixel32MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00115                               uint8_t a ) const;
00116 
00118         void blendPixel32LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00119                               uint8_t a ) const;
00120 
00122         void putPixel8( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00123                         uint8_t a ) const;
00124 
00126         void putPixel16MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00127                             uint8_t a ) const;
00128 
00130         void putPixel16LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00131                             uint8_t a ) const;
00132 
00134         void putPixel32MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00135                             uint8_t a ) const;
00136 
00138         void putPixel32LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
00139                             uint8_t a ) const;
00140 };
00141 
00142 #endif

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