1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
8 * Olivier Teulière <ipkiss@via.ecp.fr>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef WIN32_GRAPHICS_HPP
26 #define WIN32_GRAPHICS_HPP
28 #include "../src/os_graphics.hpp"
34 /// Win32 implementation of OSGraphics
35 class Win32Graphics: public OSGraphics
38 Win32Graphics( intf_thread_t *pIntf, int width, int height );
39 virtual ~Win32Graphics();
41 /// Clear the graphics
44 /// Render a bitmap on this graphics
45 virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
46 int ySrc = 0, int xDest = 0, int yDest = 0,
47 int width = -1, int height = -1,
50 /// Draw another graphics on this one
51 virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
52 int ySrc = 0, int xDest = 0, int yDest = 0,
53 int width = -1, int height = -1 );
55 /// Draw an empty rectangle on the grahics (color is #RRGGBB)
56 virtual void drawRect( int left, int top, int width, int height,
60 /// Draw a filled rectangle on the grahics (color is #RRGGBB)
61 virtual void fillRect( int left, int top, int width, int height,
64 /// Set the shape of a window with the mask of this graphics.
65 virtual void applyMaskToWindow( OSWindow &rWindow );
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 );
72 /// Tell whether the pixel at the given position is visible
73 virtual bool hit( int x, int y ) const;
75 /// Getters for the size
76 virtual int getWidth() const { return m_width; }
77 virtual int getHeight() const { return m_height; }
79 /// Get the device context handler
80 virtual HDC getDC() const { return m_hDC; }
83 virtual HRGN getMask() const { return m_mask; }
87 int m_width, m_height;
95 /// Add a segment in a region
96 void addSegmentInRegion( HRGN &rMask, int start, int end, int line );