IMPLEMENT_DYNAMIC_CLASS(wxPenList, wxList)
IMPLEMENT_DYNAMIC_CLASS(wxBrushList, wxList)
IMPLEMENT_DYNAMIC_CLASS(wxBitmapList, wxList)
+IMPLEMENT_DYNAMIC_CLASS(wxResourceCache, wxList)
/*
IMPLEMENT_DYNAMIC_CLASS(wxRect, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPoint, wxObject)
else return NULL;
#endif
+// TODO for other implementations. This should really go into
+// platform-specific directories.
+#ifdef __WXSTUBS__
+ else return NULL;
+#endif
+
#ifdef __WXGTK__
else {
wxColour *col = new wxColour( colour );
}
-void
-wxInitializeStockObjects ()
-{
+void wxInitializeStockLists () {
wxTheBrushList = new wxBrushList;
wxThePenList = new wxPenList;
wxTheFontList = new wxFontList;
wxTheBitmapList = new wxBitmapList;
+}
+void wxInitializeStockObjects ()
+{
#ifdef __WXMOTIF__
#endif
#ifdef __X__
void
wxDeleteStockObjects ()
{
- DELETEP(wxNORMAL_FONT);
- DELETEP(wxSMALL_FONT);
- DELETEP(wxITALIC_FONT);
- DELETEP(wxSWISS_FONT);
-
- DELETEP(wxRED_PEN);
- DELETEP(wxCYAN_PEN);
- DELETEP(wxGREEN_PEN);
- DELETEP(wxBLACK_PEN);
- DELETEP(wxWHITE_PEN);
- DELETEP(wxTRANSPARENT_PEN);
- DELETEP(wxBLACK_DASHED_PEN);
- DELETEP(wxGREY_PEN);
- DELETEP(wxMEDIUM_GREY_PEN);
- DELETEP(wxLIGHT_GREY_PEN);
-
- DELETEP(wxBLUE_BRUSH);
- DELETEP(wxGREEN_BRUSH);
- DELETEP(wxWHITE_BRUSH);
- DELETEP(wxBLACK_BRUSH);
- DELETEP(wxTRANSPARENT_BRUSH);
- DELETEP(wxCYAN_BRUSH);
- DELETEP(wxRED_BRUSH);
- DELETEP(wxGREY_BRUSH);
- DELETEP(wxMEDIUM_GREY_BRUSH);
- DELETEP(wxLIGHT_GREY_BRUSH);
-
- DELETEP(wxBLACK);
- DELETEP(wxWHITE);
- DELETEP(wxRED);
- DELETEP(wxBLUE);
- DELETEP(wxGREEN);
- DELETEP(wxCYAN);
- DELETEP(wxLIGHT_GREY);
-
- DELETEP(wxSTANDARD_CURSOR);
- DELETEP(wxHOURGLASS_CURSOR);
- DELETEP(wxCROSS_CURSOR);
+ wxDELETE(wxNORMAL_FONT);
+ wxDELETE(wxSMALL_FONT);
+ wxDELETE(wxITALIC_FONT);
+ wxDELETE(wxSWISS_FONT);
+
+ wxDELETE(wxRED_PEN);
+ wxDELETE(wxCYAN_PEN);
+ wxDELETE(wxGREEN_PEN);
+ wxDELETE(wxBLACK_PEN);
+ wxDELETE(wxWHITE_PEN);
+ wxDELETE(wxTRANSPARENT_PEN);
+ wxDELETE(wxBLACK_DASHED_PEN);
+ wxDELETE(wxGREY_PEN);
+ wxDELETE(wxMEDIUM_GREY_PEN);
+ wxDELETE(wxLIGHT_GREY_PEN);
+
+ wxDELETE(wxBLUE_BRUSH);
+ wxDELETE(wxGREEN_BRUSH);
+ wxDELETE(wxWHITE_BRUSH);
+ wxDELETE(wxBLACK_BRUSH);
+ wxDELETE(wxTRANSPARENT_BRUSH);
+ wxDELETE(wxCYAN_BRUSH);
+ wxDELETE(wxRED_BRUSH);
+ wxDELETE(wxGREY_BRUSH);
+ wxDELETE(wxMEDIUM_GREY_BRUSH);
+ wxDELETE(wxLIGHT_GREY_BRUSH);
+
+ wxDELETE(wxBLACK);
+ wxDELETE(wxWHITE);
+ wxDELETE(wxRED);
+ wxDELETE(wxBLUE);
+ wxDELETE(wxGREEN);
+ wxDELETE(wxCYAN);
+ wxDELETE(wxLIGHT_GREY);
+
+ wxDELETE(wxSTANDARD_CURSOR);
+ wxDELETE(wxHOURGLASS_CURSOR);
+ wxDELETE(wxCROSS_CURSOR);
+}
+
+void wxDeleteStockLists() {
+ wxDELETE(wxTheBrushList);
+ wxDELETE(wxThePenList);
+ wxDELETE(wxTheFontList);
+ wxDELETE(wxTheBitmapList);
}
wxBitmapList::wxBitmapList ()
wxBitmapList::~wxBitmapList ()
{
+ printf( "Count: %d.\n", Number() );
+
wxNode *node = First ();
while (node)
{
return wxSize(x, y);
}
+wxResourceCache::wxResourceCache () : wxList() {
+}
+
+wxResourceCache::wxResourceCache (const unsigned int the_key_type) : wxList(the_key_type) {
+}
+
+wxResourceCache::~wxResourceCache () {
+ wxNode *node = First ();
+ while (node) {
+ wxGDIObject *item = (wxGDIObject *)node->Data();
+ if (item->IsKindOf(CLASSINFO(wxBrush))) {
+ wxBrush *brush = (wxBrush *)item;
+ delete brush;
+ }
+
+ if (item->IsKindOf(CLASSINFO(wxFont))) {
+ wxFont *font = (wxFont *)item;
+ delete font;
+ }
+
+ if (item->IsKindOf(CLASSINFO(wxBitmap))) {
+ wxBitmap *bitmap = (wxBitmap *)item;
+ delete bitmap;
+ }
+
+ if (item->IsKindOf(CLASSINFO(wxColour))) {
+ wxColour *colour = (wxColour *)item;
+ delete colour;
+ }
+
+ wxNode *next = node->Next ();
+ node = next;
+ }
+}
+