Moved m_visual* wxApp[X11] members used by wxBitmap and
wxColour into a new wxXVisualInfo structure, and moved code to initialize it to a new src/x11/utilsx.cpp file (utility functions shared by wxMotif and wxX11). Added (currently unused) code in wxMotif to retrieve wxXVisualInfo; it will be used when wxMotif is switched to bitmap.cpp from wxX11. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "wx/intl.h"
|
||||
#include "wx/evtloop.h"
|
||||
#include "wx/hash.h"
|
||||
#include "wx/hashmap.h"
|
||||
|
||||
#if wxUSE_THREADS
|
||||
#include "wx/thread.h"
|
||||
@@ -58,6 +59,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
WX_DECLARE_VOIDPTR_HASH_MAP( wxXVisualInfo*, wxXVisualInfoMap );
|
||||
|
||||
extern wxList wxPendingDelete;
|
||||
extern bool wxAddIdleCallback();
|
||||
|
||||
@@ -243,11 +246,21 @@ wxApp::wxApp()
|
||||
m_topLevelWidget = (WXWidget) NULL;
|
||||
m_maxRequestSize = 0;
|
||||
m_initialDisplay = (WXDisplay*) 0;
|
||||
m_visualInfoMap = new wxXVisualInfoMap;
|
||||
}
|
||||
|
||||
wxApp::~wxApp()
|
||||
{
|
||||
delete m_eventLoop;
|
||||
|
||||
for( wxXVisualInfoMap::iterator it = m_visualInfoMap->begin(),
|
||||
end = m_visualInfoMap->end();
|
||||
it != end; ++it )
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
delete m_visualInfoMap;
|
||||
}
|
||||
|
||||
bool wxApp::Initialized()
|
||||
@@ -493,6 +506,20 @@ WXColormap wxApp::GetMainColormap(WXDisplay* display)
|
||||
return (WXColormap) c;
|
||||
}
|
||||
|
||||
wxXVisualInfo* wxApp::GetVisualInfo( WXDisplay* display )
|
||||
{
|
||||
wxXVisualInfoMap::iterator it = m_visualInfoMap->find( display );
|
||||
|
||||
if( it != m_visualInfoMap->end() ) return it->second;
|
||||
|
||||
wxXVisualInfo* vi = new wxXVisualInfo;
|
||||
wxFillXVisualInfo( vi, (Display*)display );
|
||||
|
||||
(*m_visualInfoMap)[display] = vi;
|
||||
|
||||
return vi;
|
||||
}
|
||||
|
||||
void wxExit()
|
||||
{
|
||||
int retValue = 0;
|
||||
|
Reference in New Issue
Block a user