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