X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d03bb63c48d02a9f98e460236bcf9e20d859e546..6eb37239e0d99d96181310dbd50d92158639a8dc:/src/motif/app.cpp diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 1d226a24a9..4fd539d71c 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -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 +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() @@ -293,6 +306,9 @@ void wxApp::ExitMainLoop() // Is a message/event pending? bool wxApp::Pending() { +<<<<<<< app.cpp + return XtAppPending( (XtAppContext) GetAppContext() ) != 0; +======= return m_eventLoop->Pending(); #if 0 XFlush(XtDisplay( (Widget) wxTheApp->GetTopLevelWidget() )); @@ -301,6 +317,7 @@ bool wxApp::Pending() // is found. return ((XtAppPending( (XtAppContext) GetAppContext() ) & XtIMXEvent) != 0) ; #endif +>>>>>>> 1.57 } // Dispatch a message. @@ -493,6 +510,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;