]>
git.saurik.com Git - wxWidgets.git/blob - src/dfb/wrapdfb.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/dfb/wrapdfb.cpp
3 // Purpose: wx wrappers for DirectFB interfaces
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #include "wx/dfb/wrapdfb.h"
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 bool wxDfbCheckReturn(DFBResult code
)
31 // these are programming errors, assert:
32 #define DFB_ASSERT(code) \
34 wxFAIL_MSG( _T("DirectFB error: ") _T(#code) ); \
38 DFB_ASSERT(DFB_UNSUPPORTED
);
39 DFB_ASSERT(DFB_UNIMPLEMENTED
);
40 DFB_ASSERT(DFB_INVARG
);
41 DFB_ASSERT(DFB_NOIMPL
);
42 DFB_ASSERT(DFB_MISSINGFONT
);
43 DFB_ASSERT(DFB_THIZNULL
);
44 DFB_ASSERT(DFB_INVAREA
);
45 DFB_ASSERT(DFB_DESTROYED
);
46 DFB_ASSERT(DFB_NOSUCHMETHOD
);
47 DFB_ASSERT(DFB_NOSUCHINSTANCE
);
48 DFB_ASSERT(DFB_VERSIONMISMATCH
);
52 // these are not errors, but valid return codes:
58 // FIXME: should handle the errors individually
59 wxLogError(_("DirectFB error %d occured."), (int)code
);
64 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
69 void wxDfbPtrBase::DoAddRef(wxDfbWrapperBase
*ptr
)
74 void wxDfbPtrBase::DoRelease(wxDfbWrapperBase
*ptr
)
79 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
83 wxIDirectFBPtr
wxIDirectFB::ms_ptr
;
86 void wxIDirectFB::CreateDirectFB()
89 if ( wxDfbCheckReturn(DirectFBCreate(&dfb
)) )
90 ms_ptr
= new wxIDirectFB(dfb
);
94 void wxIDirectFB::CleanUp()