win32_graphics.h 2.99 KB
Newer Older
1 2 3 4
/*****************************************************************************
 * win32_graphics.h: Win32 implementation of the Graphics and Region classes
 *****************************************************************************
 * Copyright (C) 2003 VideoLAN
Emmanuel Puig's avatar
Emmanuel Puig committed
5
 * $Id: win32_graphics.h,v 1.3 2003/04/19 02:34:47 karibu Exp $
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
 *          Emmanuel Puig    <karibu@via.ecp.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111,
 * USA.
 *****************************************************************************/

26
#ifdef WIN32
27 28 29 30 31 32 33 34 35 36 37

#ifndef VLC_SKIN_WIN32_GRAPHICS
#define VLC_SKIN_WIN32_GRAPHICS

//---------------------------------------------------------------------------
class Region;
class Window;

//---------------------------------------------------------------------------
class Win32Graphics : public Graphics
{
Emmanuel Puig's avatar
Emmanuel Puig committed
38
    protected:
39
        HDC Image;
Emmanuel Puig's avatar
Emmanuel Puig committed
40

41 42 43 44 45 46 47 48 49 50 51 52 53 54
    public:
        // Constructor
        Win32Graphics( int w, int h, Window *from = NULL );
        // Destructor
        virtual ~Win32Graphics();
        // Drawing methods
        virtual void CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
                              int sx, int sy, int Flag );
        //virtual void CopyTo(  Graphics *Dest, int dx, int dy, int dw, int dh,
        //                      int sx, int sy, int Flag );
        virtual void DrawRect( int x, int y, int w, int h, int color );

        // Clipping methods
        virtual void SetClipRegion( Region *rgn );
Emmanuel Puig's avatar
Emmanuel Puig committed
55
        virtual void ResetClipRegion();
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84

        // Specific win32 methods
        HDC GetImageHandle()    { return Image; };
};
//---------------------------------------------------------------------------
class Win32Region : public Region
{
    private:
        HRGN Rgn;
    public:
        // Constructor
        Win32Region();
        Win32Region( int x, int y, int w, int h );
        // Destructor
        ~Win32Region();
        // Modify region
        virtual void AddPoint( int x, int y );
        virtual void AddRectangle( int x, int y, int w, int h );
        virtual void AddElipse( int x, int y, int w, int h );
        virtual void Move( int x, int y );

        virtual bool Hit( int x, int y );

        // Specific win32 methods
        HRGN GetHandle() { return Rgn; };
};
//---------------------------------------------------------------------------

#endif
85 86

#endif