]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/os_graphics.hpp
e74bd60a9024c8ff1e6dfa772b59d14c629a47ec
[vlc] / modules / gui / skins2 / src / os_graphics.hpp
1 /*****************************************************************************
2  * os_graphics.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 the VideoLAN team
5  * $Id$
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
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #ifndef OS_GRAPHICS_HPP
26 #define OS_GRAPHICS_HPP
27
28 #include "skin_common.hpp"
29 #include "../utils/pointer.hpp"
30
31 class GenericBitmap;
32 class OSWindow;
33
34
35 /// OS specific graphics class
36 class OSGraphics: public SkinObject
37 {
38     public:
39         virtual ~OSGraphics() {}
40
41         /// Clear the graphics
42         virtual void clear() = 0;
43
44         /// Draw another graphics on this one
45         virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
46                                    int ySrc = 0, int xDest = 0, int yDest = 0,
47                                    int width = -1, int height = -1 ) = 0;
48
49         /// Render a bitmap on this graphics
50         virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
51                                  int ySrc = 0, int xDest = 0, int yDest = 0,
52                                  int width = -1, int height = -1,
53                                  bool blend = false) = 0;
54
55         /// Draw a filled rectangle on the grahics (color is #RRGGBB)
56         virtual void fillRect( int left, int top, int width, int height,
57                                uint32_t color ) = 0;
58
59         /// Draw an empty rectangle on the grahics (color is #RRGGBB)
60         virtual void drawRect( int left, int top, int width, int height,
61                                uint32_t color ) = 0;
62
63
64         /// Set the shape of a window with the mask of this graphics.
65         virtual void applyMaskToWindow( OSWindow &rWindow ) = 0;
66
67         /// Copy the graphics on a window
68         virtual void copyToWindow( OSWindow &rWindow, int xSrc,
69                                    int ySrc, int width, int height,
70                                    int xDest, int yDest ) = 0;
71
72         /// Tell whether the pixel at the given position is visible
73         virtual bool hit( int x, int y ) const = 0;
74
75         /// Getters
76         virtual int getWidth() const = 0;
77         virtual int getHeight() const = 0;
78
79     protected:
80         OSGraphics( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
81 };
82
83 typedef CountedPtr<OSGraphics> OSGraphicsPtr;
84
85 #endif