1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: bitmap.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Created: 01/02/97
|
1998-05-28 19:54:07 +00:00
|
|
|
// RCS-ID: $Id$
|
1998-05-20 14:01:55 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
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
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMask)
|
|
|
|
|
|
|
|
public:
|
1998-07-24 14:35:48 +00:00
|
|
|
|
|
|
|
wxMask();
|
1998-05-20 14:01:55 +00:00
|
|
|
wxMask( const wxBitmap& bitmap, const wxColour& colour );
|
1998-07-04 15:17:59 +00:00
|
|
|
wxMask( const wxBitmap& bitmap, int paletteIndex );
|
1998-05-20 14:01:55 +00:00
|
|
|
wxMask( const wxBitmap& bitmap );
|
1998-07-24 14:35:48 +00:00
|
|
|
~wxMask();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-09-05 13:59:23 +00:00
|
|
|
// implementation
|
|
|
|
|
1998-07-24 14:35:48 +00:00
|
|
|
GdkBitmap *GetBitmap() const;
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
protected:
|
1998-09-05 16:37:48 +00:00
|
|
|
|
|
|
|
friend wxBitmap;
|
1998-07-24 14:35:48 +00:00
|
|
|
|
|
|
|
GdkBitmap *m_bitmap;
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxBitmap
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-05-28 19:54:07 +00:00
|
|
|
// CMB 20/5/98: added xbm constructor and GetBitmap() method
|
1998-05-20 14:01:55 +00:00
|
|
|
class wxBitmap: public wxObject
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
1998-07-24 14:35:48 +00:00
|
|
|
wxBitmap();
|
1998-07-04 15:17:59 +00:00
|
|
|
wxBitmap( int width, int height, int depth = -1 );
|
|
|
|
wxBitmap( const char bits[], int width, int height, int depth = 1 );
|
1998-05-20 14:01:55 +00:00
|
|
|
wxBitmap( char **bits );
|
|
|
|
wxBitmap( const wxBitmap& bmp );
|
|
|
|
wxBitmap( const wxBitmap* bmp );
|
1998-07-24 14:35:48 +00:00
|
|
|
wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM);
|
|
|
|
~wxBitmap();
|
1998-05-20 14:01:55 +00:00
|
|
|
wxBitmap& operator = ( const wxBitmap& bmp );
|
|
|
|
bool operator == ( const wxBitmap& bmp );
|
|
|
|
bool operator != ( const wxBitmap& bmp );
|
1998-07-24 14:35:48 +00:00
|
|
|
bool Ok() const;
|
|
|
|
|
|
|
|
int GetHeight() const;
|
|
|
|
int GetWidth() const;
|
|
|
|
int GetDepth() const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetHeight( int height );
|
|
|
|
void SetWidth( int width );
|
|
|
|
void SetDepth( int depth );
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-07-24 14:35:48 +00:00
|
|
|
wxMask *GetMask() const;
|
1998-05-20 14:01:55 +00:00
|
|
|
void SetMask( wxMask *mask );
|
1998-07-24 14:35:48 +00:00
|
|
|
|
1998-07-12 20:06:59 +00:00
|
|
|
void Resize( int height, int width );
|
1998-07-24 14:35:48 +00:00
|
|
|
|
1998-08-23 03:22:56 +00:00
|
|
|
bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
|
1998-07-24 14:35:48 +00:00
|
|
|
bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM);
|
1998-07-04 15:17:59 +00:00
|
|
|
|
1998-07-24 14:35:48 +00:00
|
|
|
wxPalette *GetPalette() const;
|
|
|
|
wxPalette *GetColourMap() const
|
1998-05-20 14:01:55 +00:00
|
|
|
{ return GetPalette(); };
|
1998-09-05 13:59:23 +00:00
|
|
|
|
|
|
|
// implementation
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-07-24 14:35:48 +00:00
|
|
|
GdkPixmap *GetPixmap() const;
|
|
|
|
GdkBitmap *GetBitmap() const;
|
1998-09-04 12:45:34 +00:00
|
|
|
|
1998-07-24 14:35:48 +00:00
|
|
|
void DestroyImage();
|
|
|
|
void RecreateImage();
|
|
|
|
void Render();
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// no data :-)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKBITMAPH__
|