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"
|
1998-10-24 17:12:05 +00:00
|
|
|
#include "wx/image.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMask;
|
|
|
|
class wxBitmap;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMask
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMask: public wxObject
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMask)
|
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
public:
|
|
|
|
wxMask();
|
|
|
|
wxMask( const wxBitmap& bitmap, const wxColour& colour );
|
|
|
|
wxMask( const wxBitmap& bitmap, int paletteIndex );
|
|
|
|
wxMask( const wxBitmap& bitmap );
|
|
|
|
~wxMask();
|
|
|
|
|
|
|
|
// implementation
|
1998-09-05 13:59:23 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
GdkBitmap *m_bitmap;
|
|
|
|
GdkBitmap *GetBitmap() const;
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxBitmap
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxBitmap: public wxObject
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
public:
|
|
|
|
wxBitmap();
|
|
|
|
wxBitmap( int width, int height, int depth = -1 );
|
|
|
|
wxBitmap( const char bits[], int width, int height, int depth = 1 );
|
|
|
|
wxBitmap( const wxImage &image );
|
|
|
|
wxBitmap( char **bits );
|
|
|
|
wxBitmap( const wxBitmap& bmp );
|
|
|
|
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;
|
1998-10-24 17:12:05 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
wxImage ConvertToImage() const;
|
1998-07-24 14:35:48 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
int GetHeight() const;
|
|
|
|
int GetWidth() const;
|
|
|
|
int GetDepth() const;
|
|
|
|
void SetHeight( int height );
|
|
|
|
void SetWidth( int width );
|
|
|
|
void SetDepth( int depth );
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
wxMask *GetMask() const;
|
|
|
|
void SetMask( wxMask *mask );
|
1998-07-24 14:35:48 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
|
|
|
|
bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
|
1998-07-04 15:17:59 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
wxPalette *GetPalette() const;
|
|
|
|
wxPalette *GetColourMap() const
|
|
|
|
{ return GetPalette(); };
|
1998-09-05 13:59:23 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
// implementation
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-11-06 08:50:52 +00:00
|
|
|
GdkPixmap *GetPixmap() const;
|
|
|
|
GdkBitmap *GetBitmap() const;
|
1998-09-04 12:45:34 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// no data :-)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKBITMAPH__
|