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() void wxImage::InitStandardHandlers()
{ {
AddHandler( new wxBMPHandler ); AddHandler(new wxBMPHandler);
#if !defined(__WXGTK__) && !defined(__WXMOTIF__)
AddHandler(new wxXPMHandler);
#endif
} }
void wxImage::CleanUpHandlers() void wxImage::CleanUpHandlers()

View File

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

View File

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

View File

@ -76,7 +76,6 @@
#undef GetFirstChild #undef GetFirstChild
#endif #endif
#if !defined(__WXMSW__) || wxUSE_XPM_IN_MSW || wxUSE_XPM_IN_OS2
/* Closed folder */ /* Closed folder */
static char * icon1_xpm[] = { static char * icon1_xpm[] = {
/* width height ncolors chars_per_pixel */ /* 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_DIRCTRL = 1000;
static const int ID_TEXTCTRL = 1001; static const int ID_TEXTCTRL = 1001;
@ -450,7 +448,6 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
m_filterListCtrl->FillFilterList(filter, defaultFilter); m_filterListCtrl->FillFilterList(filter, defaultFilter);
m_imageList = new wxImageList(16, 16, TRUE); m_imageList = new wxImageList(16, 16, TRUE);
#if !defined(__WXMSW__) || wxUSE_XPM_IN_MSW
m_imageList->Add(wxIcon(icon1_xpm)); m_imageList->Add(wxIcon(icon1_xpm));
m_imageList->Add(wxIcon(icon2_xpm)); m_imageList->Add(wxIcon(icon2_xpm));
m_imageList->Add(wxIcon(icon3_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(icon6_xpm));
m_imageList->Add(wxIcon(icon7_xpm)); m_imageList->Add(wxIcon(icon7_xpm));
m_imageList->Add(wxIcon(icon8_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_treeCtrl->SetImageList(m_imageList);
m_showHidden = FALSE; 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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T!
ALL_SOURCES = \ ALL_SOURCES = \
generic/busyinfo.cpp \ generic/busyinfo.cpp \
@ -449,7 +449,6 @@ ALL_HEADERS = \
wxhtml.h \ wxhtml.h \
wxprec.h \ wxprec.h \
xpmdecod.h \ xpmdecod.h \
xpmhand.h \
zipstrm.h \ zipstrm.h \
zstream.h \ zstream.h \
gtk/accel.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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T!
ALL_SOURCES = \ ALL_SOURCES = \
generic/busyinfo.cpp \ generic/busyinfo.cpp \
@ -449,7 +449,6 @@ ALL_HEADERS = \
wxhtml.h \ wxhtml.h \
wxprec.h \ wxprec.h \
xpmdecod.h \ xpmdecod.h \
xpmhand.h \
zipstrm.h \ zipstrm.h \
zstream.h \ zstream.h \
gtk/accel.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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE MOTIF.T!
ALL_SOURCES = \ ALL_SOURCES = \
generic/busyinfo.cpp \ generic/busyinfo.cpp \
@ -445,7 +445,6 @@ ALL_HEADERS = \
wxhtml.h \ wxhtml.h \
wxprec.h \ wxprec.h \
xpmdecod.h \ xpmdecod.h \
xpmhand.h \
zipstrm.h \ zipstrm.h \
zstream.h \ zstream.h \
motif/accel.h \ motif/accel.h \

View File

@ -45,6 +45,7 @@
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#include "wx/image.h" #include "wx/image.h"
#include "wx/xpmdecod.h"
// missing from mingw32 header // missing from mingw32 header
#ifndef CLR_INVALID #ifndef CLR_INVALID
@ -283,9 +284,23 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
// Create from XPM data // Create from XPM data
bool wxBitmap::CreateFromXpm(const char **data) bool wxBitmap::CreateFromXpm(const char **data)
{ {
#if wxUSE_IMAGE && wxUSE_XPM
Init(); 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) wxBitmap::wxBitmap(int w, int h, int d)

View File

@ -42,10 +42,6 @@
#include "wx/msw/gdiimage.h" #include "wx/msw/gdiimage.h"
#include "wx/bitmap.h" #include "wx/bitmap.h"
#if 0 // wxUSE_XPM_IN_MSW
# include "wx/xpmhand.h"
#endif // wxUSE_XPM_IN_MSW
#ifdef __WIN16__ #ifdef __WIN16__
# include "wx/msw/curico.h" # include "wx/msw/curico.h"
#endif // __WIN16__ #endif // __WIN16__
@ -301,14 +297,6 @@ void wxGDIImage::InitStandardHandlers()
{ {
AddHandler(new wxBMPResourceHandler); AddHandler(new wxBMPResourceHandler);
AddHandler(new wxBMPFileHandler); 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 wxICOResourceHandler);
AddHandler(new wxICOFileHandler); 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! # 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)\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! # 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)\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! # 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)\utils.obj \
$(MSWDIR)\utilsexc.obj \ $(MSWDIR)\utilsexc.obj \
$(MSWDIR)\wave.obj \ $(MSWDIR)\wave.obj \
$(MSWDIR)\window.obj \ $(MSWDIR)\window.obj
$(MSWDIR)\xpmhand.obj
# TODO: Implement XPM and PNG targets in this makefile! # TODO: Implement XPM and PNG targets in this makefile!
# $(OLEDIR)\xpmhand \ # $(OLEDIR)\xpmhand \
@ -756,11 +755,6 @@ $(MSWDIR)/window.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<< <<
$(MSWDIR)/xpmhand.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/appcmn.obj: $*.$(SRCSUFF) $(COMMDIR)/appcmn.obj: $*.$(SRCSUFF)
cl @<< cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) $(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! # 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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T!
# Symantec C++ makefile for the msw objects # Symantec C++ makefile for the msw objects
@ -264,8 +264,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \
$(MSWDIR)\utilsexc.obj \ $(MSWDIR)\utilsexc.obj \
$(MSWDIR)\ole\uuid.obj \ $(MSWDIR)\ole\uuid.obj \
$(MSWDIR)\wave.obj \ $(MSWDIR)\wave.obj \
$(MSWDIR)\window.obj \ $(MSWDIR)\window.obj
$(MSWDIR)\xpmhand.obj
XPMOBJECTS = $(XPMDIR)\crbuffri.obj\ XPMOBJECTS = $(XPMDIR)\crbuffri.obj\
$(XPMDIR)\crdatfri.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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T!
# File: makefile.vc # File: makefile.vc
@ -464,7 +464,11 @@ $(WXDIR)\lib\$(WXLIBNAME).dll: $(DUMMYOBJ) $(OBJECTS)
$(link) @<< $(link) @<<
$(LINKFLAGS) $(LINKFLAGS)
-out:$(WXDIR)\lib\$(WXLIBNAME).dll -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 $(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 delayimp.lib
/delayload:ws2_32.dll /delayload:advapi32.dll /delayload:user32.dll /delayload:gdi32.dll /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 /delayload:comdlg32.dll /delayload:shell32.dll /delayload:comctl32.dll /delayload:ole32.dll
@ -653,7 +657,6 @@ clean: $(PERIPH_CLEAN_TARGET)
-rmdir ..\common\$(D) -rmdir ..\common\$(D)
-rmdir ..\html\$(D) -rmdir ..\html\$(D)
# Making documents # Making documents
docs: allhlp allhtml allpdfrtf allhtb allhtmlhelp docs: allhlp allhtml allpdfrtf allhtb allhtmlhelp
alldocs: docs alldocs: docs

View File

@ -1,6 +1,6 @@
#!/binb/wmake.exe #!/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! # 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 window.obj: $(MSWDIR)\window.cpp
*$(CCC) $(CPPFLAGS) $(IFLAGS) $< *$(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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE OS2.T!
ALL_SOURCES = \ ALL_SOURCES = \
generic/busyinfo.cpp \ generic/busyinfo.cpp \
@ -455,7 +455,6 @@ ALL_HEADERS = \
wxhtml.h \ wxhtml.h \
wxprec.h \ wxprec.h \
xpmdecod.h \ xpmdecod.h \
xpmhand.h \
zipstrm.h \ zipstrm.h \
zstream.h \ zstream.h \
os2/accel.h \ os2/accel.h \