os_graphics.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * os_graphics.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: c8cf28f998fd506da6ddeb03411b8a614b955b3c $
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 OS_GRAPHICS_HPP
00026 #define OS_GRAPHICS_HPP
00027 
00028 #include "skin_common.hpp"
00029 #include "../utils/position.hpp"
00030 #include "../utils/pointer.hpp"
00031 
00032 class GenericBitmap;
00033 class OSWindow;
00034 
00035 
00036 /// OS specific graphics class
00037 class OSGraphics: public SkinObject, public Box
00038 {
00039 public:
00040     virtual ~OSGraphics() { }
00041 
00042     /// Clear the graphics
00043     virtual void clear( int xDest = 0, int yDest = 0,
00044                         int width = -1, int height = -1) = 0;
00045 
00046     /// Draw another graphics on this one
00047     virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
00048                                int ySrc = 0, int xDest = 0, int yDest = 0,
00049                                int width = -1, int height = -1 ) = 0;
00050 
00051     /// Render a bitmap on this graphics
00052     virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
00053                              int ySrc = 0, int xDest = 0, int yDest = 0,
00054                              int width = -1, int height = -1,
00055                              bool blend = false) = 0;
00056 
00057     /// Draw a filled rectangle on the grahics (color is #RRGGBB)
00058     virtual void fillRect( int left, int top, int width, int height,
00059                            uint32_t color ) = 0;
00060 
00061     /// Draw an empty rectangle on the grahics (color is #RRGGBB)
00062     virtual void drawRect( int left, int top, int width, int height,
00063                            uint32_t color ) = 0;
00064 
00065 
00066     /// Set the shape of a window with the mask of this graphics.
00067     virtual void applyMaskToWindow( OSWindow &rWindow ) = 0;
00068 
00069     /// Copy the graphics on a window
00070     virtual void copyToWindow( OSWindow &rWindow, int xSrc,
00071                                int ySrc, int width, int height,
00072                                int xDest, int yDest ) = 0;
00073 
00074     /// Tell whether the pixel at the given position is visible
00075     virtual bool hit( int x, int y ) const = 0;
00076 
00077 protected:
00078     OSGraphics( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
00079 };
00080 
00081 typedef CountedPtr<OSGraphics> OSGraphicsPtr;
00082 
00083 #endif

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