]> git.sesse.net Git - vlc/blob - modules/gui/skins2/macosx/macosx_graphics.hpp
Removes trailing spaces. Removes tabs.
[vlc] / modules / gui / skins2 / macosx / macosx_graphics.hpp
1 /*****************************************************************************
2  * macosx_graphics.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef MACOSX_GRAPHICS_HPP
25 #define MACOSX_GRAPHICS_HPP
26
27 #include "../src/os_graphics.hpp"
28 #include <Carbon/Carbon.h>
29
30 class GenericWindow;
31 class GenericBitmap;
32
33 /// MacOSX implementation of OSGraphics
34 class MacOSXGraphics: public OSGraphics
35 {
36     public:
37         MacOSXGraphics( intf_thread_t *pIntf, int width, int height);
38
39         virtual ~MacOSXGraphics();
40
41         /// Clear the graphics
42         virtual void clear();
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 );
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 );
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 );
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 );
62
63         /// Set the shape of a window with the mask of this graphics.
64         virtual void applyMaskToWindow( OSWindow &rWindow );
65
66         /// Copy the graphics on a window
67         virtual void copyToWindow( OSWindow &rWindow, int xSrc,
68                                    int ySrc, int width, int height,
69                                    int xDest, int yDest );
70
71         /// Tell whether the pixel at the given position is visible
72         virtual bool hit( int x, int y ) const;
73
74         /// Getters
75         virtual int getWidth() const { return m_width; }
76         virtual int getHeight() const { return m_height; }
77
78     private:
79         /// Size of the image
80         int m_width, m_height;
81 };
82
83
84 #endif