removed redundant code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-12-28 19:16:05 +00:00
parent 06acc7d9a6
commit bb356c9ea7
3 changed files with 2 additions and 220 deletions

View File

@@ -196,17 +196,7 @@ public:
inline bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; } inline bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; }
inline bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; } inline bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; }
// Format handling
static inline wxList& GetHandlers() { return sm_handlers; }
static void AddHandler(wxBitmapHandler *handler);
static void InsertHandler(wxBitmapHandler *handler);
static bool RemoveHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType type);
static wxBitmapHandler *FindHandler(wxBitmapType type);
static void InitStandardHandlers(); static void InitStandardHandlers();
static void CleanUpHandlers();
protected: protected:
// TODO: Implementation // TODO: Implementation

View File

@@ -22,12 +22,9 @@
#include "wx/image.h" #include "wx/image.h"
#include "wx/xpmdecod.h" #include "wx/xpmdecod.h"
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxBitmapBase , wxGDIObject ) IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject )
IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandlerBase, wxObject )
#endif
#ifdef __DARWIN__ #ifdef __DARWIN__
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
@@ -355,9 +352,6 @@ wxBitmapRefData::~wxBitmapRefData()
DisposeBitmapRefData( this ) ; DisposeBitmapRefData( this ) ;
} }
wxList wxBitmapBase::sm_handlers;
bool wxBitmap::CopyFromIcon(const wxIcon& icon) bool wxBitmap::CopyFromIcon(const wxIcon& icon)
{ {
Ref(icon) ; Ref(icon) ;
@@ -1001,68 +995,6 @@ PicHandle wxBitmap::GetPict() const
return picture; // return our groovy pict handle return picture; // return our groovy pict handle
} }
void wxBitmap::AddHandler(wxBitmapHandler *handler)
{
sm_handlers.Append(handler);
}
void wxBitmap::InsertHandler(wxBitmapHandler *handler)
{
sm_handlers.Insert(handler);
}
bool wxBitmap::RemoveHandler(const wxString& name)
{
wxBitmapHandler *handler = FindHandler(name);
if ( handler )
{
sm_handlers.DeleteObject(handler);
return TRUE;
}
else
return FALSE;
}
wxBitmapHandler *wxBitmap::FindHandler(const wxString& name)
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
if ( handler->GetName() == name )
return handler;
node = node->Next();
}
return NULL;
}
wxBitmapHandler *wxBitmap::FindHandler(const wxString& extension, wxBitmapType type)
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
if ( handler->GetExtension() == extension &&
(type == -1 || handler->GetType() == type) )
return handler;
node = node->Next();
}
return NULL;
}
wxBitmapHandler *wxBitmap::FindHandler(wxBitmapType type)
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
if (handler->GetType() == type)
return handler;
node = node->Next();
}
return NULL;
}
/* /*
* wxMask * wxMask
*/ */
@@ -1223,8 +1155,6 @@ bool wxMask::PointMasked(int x, int y)
* wxBitmapHandler * wxBitmapHandler
*/ */
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth) bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
{ {
return FALSE; return FALSE;
@@ -1295,40 +1225,6 @@ bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
return FALSE ; return FALSE ;
} }
#if 0 // The following is an example for creating a bitmap handler
// TODO: bitmap handlers, a bit like this:
class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler
{
DECLARE_DYNAMIC_CLASS(wxBMPResourceHandler)
public:
inline wxBMPResourceHandler()
{
m_name = "Windows bitmap resource";
m_extension = "";
m_type = wxBITMAP_TYPE_BMP_RESOURCE;
};
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight);
};
IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
#endif
void wxBitmap::CleanUpHandlers()
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
wxNode *next = node->Next();
delete handler;
delete node;
node = next;
}
}
void wxBitmap::InitStandardHandlers() void wxBitmap::InitStandardHandlers()
{ {
AddHandler(new wxPICTResourceHandler) ; AddHandler(new wxPICTResourceHandler) ;

View File

@@ -22,12 +22,9 @@
#include "wx/image.h" #include "wx/image.h"
#include "wx/xpmdecod.h" #include "wx/xpmdecod.h"
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxBitmapBase , wxGDIObject ) IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject )
IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandlerBase, wxObject )
#endif
#ifdef __DARWIN__ #ifdef __DARWIN__
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
@@ -355,9 +352,6 @@ wxBitmapRefData::~wxBitmapRefData()
DisposeBitmapRefData( this ) ; DisposeBitmapRefData( this ) ;
} }
wxList wxBitmapBase::sm_handlers;
bool wxBitmap::CopyFromIcon(const wxIcon& icon) bool wxBitmap::CopyFromIcon(const wxIcon& icon)
{ {
Ref(icon) ; Ref(icon) ;
@@ -1001,68 +995,6 @@ PicHandle wxBitmap::GetPict() const
return picture; // return our groovy pict handle return picture; // return our groovy pict handle
} }
void wxBitmap::AddHandler(wxBitmapHandler *handler)
{
sm_handlers.Append(handler);
}
void wxBitmap::InsertHandler(wxBitmapHandler *handler)
{
sm_handlers.Insert(handler);
}
bool wxBitmap::RemoveHandler(const wxString& name)
{
wxBitmapHandler *handler = FindHandler(name);
if ( handler )
{
sm_handlers.DeleteObject(handler);
return TRUE;
}
else
return FALSE;
}
wxBitmapHandler *wxBitmap::FindHandler(const wxString& name)
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
if ( handler->GetName() == name )
return handler;
node = node->Next();
}
return NULL;
}
wxBitmapHandler *wxBitmap::FindHandler(const wxString& extension, wxBitmapType type)
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
if ( handler->GetExtension() == extension &&
(type == -1 || handler->GetType() == type) )
return handler;
node = node->Next();
}
return NULL;
}
wxBitmapHandler *wxBitmap::FindHandler(wxBitmapType type)
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
if (handler->GetType() == type)
return handler;
node = node->Next();
}
return NULL;
}
/* /*
* wxMask * wxMask
*/ */
@@ -1223,8 +1155,6 @@ bool wxMask::PointMasked(int x, int y)
* wxBitmapHandler * wxBitmapHandler
*/ */
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth) bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
{ {
return FALSE; return FALSE;
@@ -1295,40 +1225,6 @@ bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
return FALSE ; return FALSE ;
} }
#if 0 // The following is an example for creating a bitmap handler
// TODO: bitmap handlers, a bit like this:
class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler
{
DECLARE_DYNAMIC_CLASS(wxBMPResourceHandler)
public:
inline wxBMPResourceHandler()
{
m_name = "Windows bitmap resource";
m_extension = "";
m_type = wxBITMAP_TYPE_BMP_RESOURCE;
};
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight);
};
IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
#endif
void wxBitmap::CleanUpHandlers()
{
wxNode *node = sm_handlers.First();
while ( node )
{
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
wxNode *next = node->Next();
delete handler;
delete node;
node = next;
}
}
void wxBitmap::InitStandardHandlers() void wxBitmap::InitStandardHandlers()
{ {
AddHandler(new wxPICTResourceHandler) ; AddHandler(new wxPICTResourceHandler) ;