1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: bitmap.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-05-28 19:54:07 +00:00
|
|
|
// RCS-ID: $Id$
|
1998-10-24 17:12:05 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-09-04 12:45:34 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKBITMAPH__
|
|
|
|
#define __GTKBITMAPH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/string.h"
|
|
|
|
#include "wx/palette.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMask;
|
|
|
|
class wxBitmap;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMask
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMask: public wxObject
|
|
|
|
{
|
1998-11-06 08:50:52 +00:00
|
|
|
public:
|
1999-08-24 20:26:06 +00:00
|
|
|
wxMask();
|
|
|
|
wxMask( const wxBitmap& bitmap, const wxColour& colour );
|
|
|
|
wxMask( const wxBitmap& bitmap, int paletteIndex );
|
|
|
|
wxMask( const wxBitmap& bitmap );
|
|
|
|
~wxMask();
|
1999-06-13 15:24:01 +00:00
|
|
|
|
1999-08-24 20:26:06 +00:00
|
|
|
bool Create( const wxBitmap& bitmap, const wxColour& colour );
|
|
|
|
bool Create( const wxBitmap& bitmap, int paletteIndex );
|
|
|
|
bool Create( const wxBitmap& bitmap );
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
GdkBitmap *m_bitmap;
|
|
|
|
|
|
|
|
GdkBitmap *GetBitmap() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMask)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxBitmap
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxBitmap: public wxObject
|
|
|
|
{
|
1998-11-06 08:50:52 +00:00
|
|
|
public:
|
1999-08-24 20:26:06 +00:00
|
|
|
wxBitmap();
|
|
|
|
wxBitmap( int width, int height, int depth = -1 );
|
|
|
|
wxBitmap( const char bits[], int width, int height, int depth = 1 );
|
|
|
|
wxBitmap( const char **bits );
|
|
|
|
wxBitmap( char **bits );
|
|
|
|
wxBitmap( const wxBitmap& bmp );
|
|
|
|
wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
|
|
|
|
~wxBitmap();
|
|
|
|
wxBitmap& operator = ( const wxBitmap& bmp );
|
|
|
|
bool operator == ( const wxBitmap& bmp );
|
|
|
|
bool operator != ( const wxBitmap& bmp );
|
|
|
|
bool Ok() const;
|
|
|
|
|
|
|
|
int GetHeight() const;
|
|
|
|
int GetWidth() const;
|
|
|
|
int GetDepth() const;
|
|
|
|
|
|
|
|
wxMask *GetMask() const;
|
|
|
|
void SetMask( wxMask *mask );
|
|
|
|
|
|
|
|
bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
|
|
|
|
bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
|
|
|
|
|
|
|
|
wxPalette *GetPalette() const;
|
|
|
|
wxPalette *GetColourMap() const
|
1998-11-06 08:50:52 +00:00
|
|
|
{ return GetPalette(); };
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1999-08-24 20:26:06 +00:00
|
|
|
// implementation
|
1999-11-22 19:44:25 +00:00
|
|
|
// --------------
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-08-24 20:26:06 +00:00
|
|
|
void SetHeight( int height );
|
|
|
|
void SetWidth( int width );
|
|
|
|
void SetDepth( int depth );
|
|
|
|
void SetPixmap( GdkPixmap *pixmap );
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1999-08-24 20:26:06 +00:00
|
|
|
GdkPixmap *GetPixmap() const;
|
|
|
|
GdkBitmap *GetBitmap() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKBITMAPH__
|