1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/motif/bmpmotif.h
3 // Purpose:     Motif-specific bitmap routines
4 // Author:      Julian Smart, originally in bitmap.h
5 // Modified by:
6 // Created:     25/03/2003
7 // Copyright:   (c) Julian Smart
8 // Licence:     wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 #ifndef _WX_BMPMOTIF_H_
12 #define _WX_BMPMOTIF_H_
13 
14 #include "wx/defs.h"
15 #include "wx/bitmap.h"
16 
17 class WXDLLIMPEXP_CORE wxBitmapCache
18 {
19 public:
wxBitmapCache()20     wxBitmapCache()
21     {
22         m_labelPixmap = (WXPixmap)NULL;
23         m_armPixmap = (WXPixmap)NULL;
24         m_insensPixmap = (WXPixmap)NULL;
25         m_image = (WXImage)NULL;
26         m_display = NULL;
27         SetColoursChanged();
28     }
29 
30     ~wxBitmapCache();
31 
32     void SetColoursChanged();
33     void SetBitmap( const wxBitmap& bitmap );
34 
35     WXPixmap GetLabelPixmap( WXWidget w );
36     WXPixmap GetInsensPixmap( WXWidget w = (WXWidget)NULL );
37     WXPixmap GetArmPixmap( WXWidget w );
38 private:
39     void InvalidateCache();
40     void CreateImageIfNeeded( WXWidget w );
41 
42     WXPixmap GetPixmapFromCache(WXWidget w);
43 
44     struct
45     {
46         bool label  : 1;
47         bool arm    : 1;
48         bool insens : 1;
49     } m_recalcPixmaps;
50     wxBitmap m_bitmap;
51     WXDisplay* m_display;
52     WXPixmap m_labelPixmap, m_armPixmap, m_insensPixmap;
53     WXImage m_image;
54 };
55 
56 #endif // _WX_BMPMOTIF_H_
57