switched to new XPM code in wxMSW

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2001-05-08 22:44:34 +00:00
parent 638a0b2c72
commit 66e23ad208
17 changed files with 37 additions and 78 deletions

View File

@ -1023,7 +1023,10 @@ wxImageHandler *wxImage::FindHandlerMime( const wxString& mimetype )
void wxImage::InitStandardHandlers()
{
AddHandler( new wxBMPHandler );
AddHandler(new wxBMPHandler);
#if !defined(__WXGTK__) && !defined(__WXMOTIF__)
AddHandler(new wxXPMHandler);
#endif
}
void wxImage::CleanUpHandlers()

View File

@ -817,7 +817,6 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
}
case wxBITMAP_TYPE_XPM_DATA:
{
#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
@ -826,9 +825,6 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
return wxNullBitmap;
}
return wxBitmap(item->GetValue1());
#else
wxLogWarning(_("No XPM facility available!"));
#endif
break;
}
default:
@ -974,7 +970,6 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
{
// *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
/*
#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
@ -984,9 +979,6 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
return NULL;
}
return wxIcon((char **)item->GetValue1());
#else
wxLogWarning(_("No XPM facility available!"));
#endif
*/
wxLogWarning(_("No XPM icon facility available!"));
break;

View File

@ -2468,7 +2468,6 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
}
case wxBITMAP_TYPE_XPM_DATA:
{
#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
@ -2476,10 +2475,6 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
return wxNullBitmap;
}
return wxBitmap((char **)item->GetValue1());
#else
wxLogWarning(_("No XPM facility available!"));
break;
#endif
}
default:
{
@ -2625,7 +2620,6 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
{
// *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
/*
#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
@ -2635,9 +2629,6 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
return NULL;
}
return wxIcon((char **)item->GetValue1());
#else
wxLogWarning(_("No XPM facility available!"));
#endif
*/
wxLogWarning(_("No XPM icon facility available!"));
break;

View File

@ -76,7 +76,6 @@
#undef GetFirstChild
#endif
#if !defined(__WXMSW__) || wxUSE_XPM_IN_MSW || wxUSE_XPM_IN_OS2
/* Closed folder */
static char * icon1_xpm[] = {
/* width height ncolors chars_per_pixel */
@ -298,7 +297,6 @@ static char * icon8_xpm[] = {
" ",
" ",
" "};
#endif // !wxMSW
static const int ID_DIRCTRL = 1000;
static const int ID_TEXTCTRL = 1001;
@ -450,7 +448,6 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
m_filterListCtrl->FillFilterList(filter, defaultFilter);
m_imageList = new wxImageList(16, 16, TRUE);
#if !defined(__WXMSW__) || wxUSE_XPM_IN_MSW
m_imageList->Add(wxIcon(icon1_xpm));
m_imageList->Add(wxIcon(icon2_xpm));
m_imageList->Add(wxIcon(icon3_xpm));
@ -459,18 +456,6 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
m_imageList->Add(wxIcon(icon6_xpm));
m_imageList->Add(wxIcon(icon7_xpm));
m_imageList->Add(wxIcon(icon8_xpm));
#elif defined(__WXMSW__)
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CLOSED_FOLDER"), wxBITMAP_TYPE_ICO_RESOURCE));
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_OPEN_FOLDER"), wxBITMAP_TYPE_ICO_RESOURCE));
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FILE"), wxBITMAP_TYPE_ICO_RESOURCE));
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_COMPUTER"), wxBITMAP_TYPE_ICO_RESOURCE));
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_DRIVE"), wxBITMAP_TYPE_ICO_RESOURCE));
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CDROM"), wxBITMAP_TYPE_ICO_RESOURCE));
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FLOPPY"), wxBITMAP_TYPE_ICO_RESOURCE));
m_imageList->Add(wxIcon(wxT("wxICON_SMALL_REMOVEABLE"), wxBITMAP_TYPE_ICO_RESOURCE));
#else
#error "Sorry, we don't have icons available for this platforms."
#endif
m_treeCtrl->SetImageList(m_imageList);
m_showHidden = FALSE;

View File

@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 16:57, 2001/05/01
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T!
ALL_SOURCES = \
generic/busyinfo.cpp \
@ -449,7 +449,6 @@ ALL_HEADERS = \
wxhtml.h \
wxprec.h \
xpmdecod.h \
xpmhand.h \
zipstrm.h \
zstream.h \
gtk/accel.h \

View File

@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 16:57, 2001/05/01
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T!
ALL_SOURCES = \
generic/busyinfo.cpp \
@ -449,7 +449,6 @@ ALL_HEADERS = \
wxhtml.h \
wxprec.h \
xpmdecod.h \
xpmhand.h \
zipstrm.h \
zstream.h \
gtk/accel.h \

View File

@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 01:27, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE MOTIF.T!
ALL_SOURCES = \
generic/busyinfo.cpp \
@ -445,7 +445,6 @@ ALL_HEADERS = \
wxhtml.h \
wxprec.h \
xpmdecod.h \
xpmhand.h \
zipstrm.h \
zstream.h \
motif/accel.h \

View File

@ -45,6 +45,7 @@
#include "wx/msw/dib.h"
#include "wx/image.h"
#include "wx/xpmdecod.h"
// missing from mingw32 header
#ifndef CLR_INVALID
@ -283,9 +284,23 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
// Create from XPM data
bool wxBitmap::CreateFromXpm(const char **data)
{
#if wxUSE_IMAGE && wxUSE_XPM
Init();
return Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
wxCHECK_MSG( data != NULL, FALSE, wxT("invalid bitmap data") )
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(data);
wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") )
*this = wxBitmap(img);
if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this);
return TRUE;
#else
return FALSE;
#endif
}
wxBitmap::wxBitmap(int w, int h, int d)

View File

@ -42,10 +42,6 @@
#include "wx/msw/gdiimage.h"
#include "wx/bitmap.h"
#if 0 // wxUSE_XPM_IN_MSW
# include "wx/xpmhand.h"
#endif // wxUSE_XPM_IN_MSW
#ifdef __WIN16__
# include "wx/msw/curico.h"
#endif // __WIN16__
@ -301,14 +297,6 @@ void wxGDIImage::InitStandardHandlers()
{
AddHandler(new wxBMPResourceHandler);
AddHandler(new wxBMPFileHandler);
// GRG: Add these handlers by default if XPM support is enabled
#if 0 // wxUSE_XPM_IN_MSW
AddHandler(new wxXPMFileHandler);
AddHandler(new wxXPMDataHandler);
#endif // wxUSE_XPM_IN_MSW
AddHandler(new wxICOResourceHandler);
AddHandler(new wxICOFileHandler);
}

View File

@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 01:26, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T!
#
@ -601,8 +601,6 @@ $(MSWDIR)\wave.obj: $(MSWDIR)\wave.$(SRCSUFF)
$(MSWDIR)\window.obj: $(MSWDIR)\window.$(SRCSUFF)
$(MSWDIR)\xpmhand.obj: $(MSWDIR)\xpmhand.$(SRCSUFF)
########################################################

View File

@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 01:26, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
#
@ -477,8 +477,6 @@ $(MSWDIR)\wave.obj: $(MSWDIR)\wave.$(SRCSUFF)
$(MSWDIR)\window.obj: $(MSWDIR)\window.$(SRCSUFF)
$(MSWDIR)\xpmhand.obj: $(MSWDIR)\xpmhand.$(SRCSUFF)
########################################################

View File

@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 01:26, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T!
#
@ -268,8 +268,7 @@ MSWOBJS2 = $(MSWDIR)\palette.obj \
$(MSWDIR)\utils.obj \
$(MSWDIR)\utilsexc.obj \
$(MSWDIR)\wave.obj \
$(MSWDIR)\window.obj \
$(MSWDIR)\xpmhand.obj
$(MSWDIR)\window.obj
# TODO: Implement XPM and PNG targets in this makefile!
# $(OLEDIR)\xpmhand \
@ -756,11 +755,6 @@ $(MSWDIR)/window.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(MSWDIR)/xpmhand.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/appcmn.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)

View File

@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 01:26, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
#

View File

@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 01:26, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T!
# Symantec C++ makefile for the msw objects
@ -264,8 +264,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \
$(MSWDIR)\utilsexc.obj \
$(MSWDIR)\ole\uuid.obj \
$(MSWDIR)\wave.obj \
$(MSWDIR)\window.obj \
$(MSWDIR)\xpmhand.obj
$(MSWDIR)\window.obj
XPMOBJECTS = $(XPMDIR)\crbuffri.obj\
$(XPMDIR)\crdatfri.obj\

View File

@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 01:26, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T!
# File: makefile.vc
@ -464,7 +464,11 @@ $(WXDIR)\lib\$(WXLIBNAME).dll: $(DUMMYOBJ) $(OBJECTS)
$(link) @<<
$(LINKFLAGS)
-out:$(WXDIR)\lib\$(WXLIBNAME).dll
<<<<<<< vc.t
$(DUMMYOBJ) $(OBJECTS) $(guilibsdll) shell32.lib comctl32.lib ctl3d32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib odbc32.lib advapi32.lib winmm.lib $(GL_LIBS) $(WXDIR)\lib\png$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib $(WXDIR)\lib\jpeg$(LIBEXT).lib $(WXDIR)\lib\tiff$(LIBEXT).lib
=======
$(DUMMYOBJ) $(OBJECTS) $(guilibsdll) shell32.lib comctl32.lib ctl3d32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib odbc32.lib advapi32.lib winmm.lib $(GL_LIBS) $(WXDIR)\lib\png$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib $(WXDIR)\lib\jpeg$(LIBEXT).lib $(WXDIR)\lib\tiff$(LIBEXT).lib
>>>>>>> 1.32
delayimp.lib
/delayload:ws2_32.dll /delayload:advapi32.dll /delayload:user32.dll /delayload:gdi32.dll
/delayload:comdlg32.dll /delayload:shell32.dll /delayload:comctl32.dll /delayload:ole32.dll
@ -653,7 +657,6 @@ clean: $(PERIPH_CLEAN_TARGET)
-rmdir ..\common\$(D)
-rmdir ..\html\$(D)
# Making documents
docs: allhlp allhtml allpdfrtf allhtb allhtmlhelp
alldocs: docs

View File

@ -1,6 +1,6 @@
#!/binb/wmake.exe
# This file was automatically generated by tmake at 01:26, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
#
@ -647,9 +647,6 @@ wave.obj: $(MSWDIR)\wave.cpp
window.obj: $(MSWDIR)\window.cpp
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
#xpmhand.obj: $(MSWDIR)\xpmhand.cpp
# *$(CCC) $(CPPFLAGS) $(IFLAGS) $<
########################################################

View File

@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 01:27, 2001/04/29
# This file was automatically generated by tmake at 00:44, 2001/05/09
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE OS2.T!
ALL_SOURCES = \
generic/busyinfo.cpp \
@ -455,7 +455,6 @@ ALL_HEADERS = \
wxhtml.h \
wxprec.h \
xpmdecod.h \
xpmhand.h \
zipstrm.h \
zstream.h \
os2/accel.h \