#include "wx/evtloop.h"
#include "wx/dfb/private.h"
+#include "wx/private/fontmgr.h"
//-----------------------------------------------------------------------------
// wxApp initialization
{
}
-IDirectFBPtr wxApp::GetDirectFBInterface()
-{
- return m_dfb;
-}
-
bool wxApp::Initialize(int& argc, wxChar **argv)
{
if ( !wxAppBase::Initialize(argc, argv) )
return false;
- if ( !DFB_CALL( DirectFBInit(&argc, &argv) ) )
+ if ( !wxDfbCheckReturn(DirectFBInit(&argc, &argv)) )
return false;
- if ( !DFB_CALL( DirectFBCreate(&m_dfb) ) )
+ if ( !wxIDirectFB::Get() )
return false;
- #warning "FIXME: theme override is temporary"
- wxTheme::Set(wxTheme::Create(_T("gtk")));
-
return true;
}
{
wxAppBase::CleanUp();
- m_dfb.Reset();
+ wxFontsManager::CleanUp();
+
+ wxEventLoop::CleanUp();
+ wxIDirectFB::CleanUp();
}
//-----------------------------------------------------------------------------
static wxVideoMode GetCurrentVideoMode()
{
- wxVideoMode m;
+ wxIDirectFBDisplayLayerPtr layer(wxIDirectFB::Get()->GetDisplayLayer());
+ if ( !layer )
+ return wxVideoMode(); // invalid
- IDirectFBSurfacePtr surface(wxDfbGetPrimarySurface());
- if ( !surface )
- return m; // invalid
-
- DFB_CALL( surface->GetSize(surface, &m.w, &m.h) );
- m.bpp = wxDfbGetSurfaceDepth(surface);
-
- return m;
+ return layer->GetVideoMode();
}
wxVideoMode wxApp::GetDisplayMode() const
bool wxApp::SetDisplayMode(const wxVideoMode& mode)
{
- if ( !DFB_CALL( m_dfb->SetVideoMode(m_dfb, mode.w, mode.h, mode.bpp) ) )
+ if ( !wxIDirectFB::Get()->SetVideoMode(mode.w, mode.h, mode.bpp) )
return false;
m_videoMode = mode;
wxLog::Suspend();
if ( wxEventLoop::GetActive() )
- {
- while (wxEventLoop::GetActive()->Pending())
- wxEventLoop::GetActive()->Dispatch();
- }
+ wxEventLoop::GetActive()->Yield();
// it's necessary to call ProcessIdle() to update the frames sizes which
// might have been changed (it also will update other things set from