]> git.sesse.net Git - vlc/blob - modules/gui/skins/x11/x11_bitmap.h
* added transparency in X11 skins
[vlc] / modules / gui / skins / x11 / x11_bitmap.h
1 /*****************************************************************************
2  * x11_bitmap.h: X11 implementation of the Bitmap class
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: x11_bitmap.h,v 1.3 2003/05/18 17:48:05 asmax Exp $
6  *
7  * Authors: Cyril Deguet     <asmax@videolan.org>
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., 59 Temple Place - Suite 330, Boston, MA  02111,
22  * USA.
23  *****************************************************************************/
24
25
26 #ifndef VLC_X11_BITMAP
27 #define VLC_X11_BITMAP
28
29 //--- X11 -------------------------------------------------------------------
30 #include <X11/Xlib.h>
31
32 //--- GENERAL ---------------------------------------------------------------
33 #include <string>
34 using namespace std;
35
36 //---------------------------------------------------------------------------
37 struct intf_thread_t;
38 class Bitmap;
39 class Graphics;
40
41 //---------------------------------------------------------------------------
42 class X11Bitmap : public Bitmap
43 {
44     private:
45         intf_thread_t *p_intf;
46         Display *display;
47         XImage *Bmp;
48
49     public:
50         // Constructors
51         X11Bitmap( intf_thread_t *_p_intf, string FileName, int AColor );
52         X11Bitmap( intf_thread_t *_p_intf, Graphics *from, int x, int y,
53                      int w, int h, int AColor );
54         X11Bitmap( intf_thread_t *_p_intf, Bitmap *c );
55
56         // Destructor
57         virtual ~X11Bitmap();
58
59         virtual void DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
60                                  Graphics *dest );
61         virtual bool Hit( int x, int y );
62
63         virtual int  GetBmpPixel( int x, int y );
64         virtual void SetBmpPixel( int x, int y, int color );
65
66     protected:
67         char *LoadFromFile( string fileName, int depth, int AColor, int &width, 
68                             int &height);
69 };
70 //---------------------------------------------------------------------------
71
72 #endif