X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3c861501a451503b31c075ccb59d16b0ae01e99..873fd4af5f9ed1f078636af1ae9ea21bbed06b5a:/src/dfb/app.cpp diff --git a/src/dfb/app.cpp b/src/dfb/app.cpp index 31bdf0f350..2883ee6f54 100644 --- a/src/dfb/app.cpp +++ b/src/dfb/app.cpp @@ -39,25 +39,17 @@ wxApp::~wxApp() { } -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; } @@ -65,7 +57,8 @@ void wxApp::CleanUp() { wxAppBase::CleanUp(); - m_dfb.Reset(); + wxEventLoop::CleanUp(); + wxIDirectFB::CleanUp(); } //----------------------------------------------------------------------------- @@ -74,16 +67,11 @@ void wxApp::CleanUp() static wxVideoMode GetCurrentVideoMode() { - wxVideoMode m; - - IDirectFBSurfacePtr surface(wxDfbGetPrimarySurface()); - if ( !surface ) - return m; // invalid - - DFB_CALL( surface->GetSize(surface, &m.w, &m.h) ); - m.bpp = wxDfbGetSurfaceDepth(surface); + wxIDirectFBDisplayLayerPtr layer(wxIDirectFB::Get()->GetDisplayLayer()); + if ( !layer ) + return wxVideoMode(); // invalid - return m; + return layer->GetVideoMode(); } wxVideoMode wxApp::GetDisplayMode() const @@ -96,7 +84,7 @@ 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;