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;
|
1998-07-22 18:13:31 -04:00
|
|
|
class wxToolBar;
|
1998-06-02 15:04:33 -04:00
|
|
|
class wxBitmapButton;
|
|
|
|
class wxStaticBitmap;
|
1998-07-27 19:01:43 -04:00
|
|
|
class wxFrame;
|
1998-08-15 06:52:09 -04:00
|
|
|
class wxDialog;
|
1998-08-10 13:53:44 -04:00
|
|
|
class wxTreeCtrl;
|
1998-09-04 07:25:34 -04:00
|
|
|
class wxNotebook;
|
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:
|
1998-07-24 10:35:48 -04:00
|
|
|
|
|
|
|
wxMask();
|
1998-05-20 10:01:55 -04:00
|
|
|
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 );
|
1998-07-24 10:35:48 -04:00
|
|
|
~wxMask();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-05-28 15:54:07 -04:00
|
|
|
private:
|
1998-07-24 10:35:48 -04:00
|
|
|
|
1998-05-28 15:54:07 -04:00
|
|
|
friend wxBitmap;
|
|
|
|
friend wxDC;
|
|
|
|
friend wxPaintDC;
|
1998-07-22 18:13:31 -04:00
|
|
|
friend wxToolBar;
|
1998-06-02 15:04:33 -04:00
|
|
|
friend wxBitmapButton;
|
|
|
|
friend wxStaticBitmap;
|
1998-07-27 19:01:43 -04:00
|
|
|
friend wxFrame;
|
1998-08-15 06:52:09 -04:00
|
|
|
friend wxDialog;
|
1998-08-10 13:53:44 -04:00
|
|
|
friend wxTreeCtrl;
|
1998-09-04 07:25:34 -04:00
|
|
|
friend wxNotebook;
|
1998-07-24 10:35:48 -04:00
|
|
|
|
|
|
|
GdkBitmap *GetBitmap() const;
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
protected:
|
1998-07-24 10:35:48 -04:00
|
|
|
|
|
|
|
GdkBitmap *m_bitmap;
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// 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:
|
|
|
|
|
1998-07-24 10:35:48 -04:00
|
|
|
wxBitmap();
|
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-24 10:35:48 -04:00
|
|
|
wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM);
|
|
|
|
~wxBitmap();
|
1998-05-20 10:01:55 -04:00
|
|
|
wxBitmap& operator = ( const wxBitmap& bmp );
|
|
|
|
bool operator == ( const wxBitmap& bmp );
|
|
|
|
bool operator != ( const wxBitmap& bmp );
|
1998-07-24 10:35:48 -04:00
|
|
|
bool Ok() const;
|
|
|
|
|
|
|
|
int GetHeight() const;
|
|
|
|
int GetWidth() const;
|
|
|
|
int GetDepth() 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
|
|
|
|
1998-07-24 10:35:48 -04:00
|
|
|
wxMask *GetMask() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
void SetMask( wxMask *mask );
|
1998-07-24 10:35:48 -04:00
|
|
|
|
1998-07-12 16:06:59 -04:00
|
|
|
void Resize( int height, int width );
|
1998-07-24 10:35:48 -04:00
|
|
|
|
1998-08-22 23:22:56 -04:00
|
|
|
bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
|
1998-07-24 10:35:48 -04:00
|
|
|
bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM);
|
1998-07-04 11:17:59 -04:00
|
|
|
|
1998-07-24 10:35:48 -04:00
|
|
|
wxPalette *GetPalette() const;
|
|
|
|
wxPalette *GetColourMap() const
|
1998-05-20 10:01:55 -04:00
|
|
|
{ return GetPalette(); };
|
|
|
|
|
1998-05-28 15:54:07 -04:00
|
|
|
private:
|
1998-07-24 10:35:48 -04:00
|
|
|
|
1998-05-28 15:54:07 -04:00
|
|
|
friend wxDC;
|
|
|
|
friend wxPaintDC;
|
|
|
|
friend wxMemoryDC;
|
1998-07-22 18:13:31 -04:00
|
|
|
friend wxToolBar;
|
1998-06-02 15:04:33 -04:00
|
|
|
friend wxBitmapButton;
|
|
|
|
friend wxStaticBitmap;
|
1998-07-27 19:01:43 -04:00
|
|
|
friend wxFrame;
|
1998-08-15 06:52:09 -04:00
|
|
|
friend wxDialog;
|
1998-08-10 13:53:44 -04:00
|
|
|
friend wxTreeCtrl;
|
1998-09-04 08:43:41 -04:00
|
|
|
friend wxNotebook;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-07-24 10:35:48 -04:00
|
|
|
GdkPixmap *GetPixmap() const;
|
|
|
|
GdkBitmap *GetBitmap() const;
|
1998-09-03 17:46:47 -04:00
|
|
|
|
1998-07-24 10:35:48 -04:00
|
|
|
void DestroyImage();
|
|
|
|
void RecreateImage();
|
|
|
|
void Render();
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
// no data :-)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKBITMAPH__
|