]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/utils.cpp
add support for alpha in color dialog on OSX, see #14127
[wxWidgets.git] / src / dfb / utils.cpp
index 2f1e7da32ea35d3fc26b9be2d605f70148b6b6d8..da9e2baa9d582ed0e07a67f6630fc636373d8d98 100644 (file)
 #endif
 
 #include "wx/utils.h"
+#include "wx/evtloop.h"
 #include "wx/apptrait.h"
 #include "wx/unix/execute.h"
+#include "wx/unix/private/timer.h"
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
@@ -38,6 +40,17 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
     return wxPORT_DFB;
 }
 
+
+wxEventLoopBase* wxGUIAppTraits::CreateEventLoop()
+{
+    return new wxEventLoop;
+}
+
+wxTimerImpl *wxGUIAppTraits::CreateTimerImpl(wxTimer *timer)
+{
+    return new wxUnixTimerImpl(timer);
+}
+
 // ----------------------------------------------------------------------------
 // display characteristics
 // ----------------------------------------------------------------------------
@@ -83,90 +96,6 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
     wxDisplaySize(width, height);
 }
 
-//-----------------------------------------------------------------------------
-// surface manipulation helpers
-//-----------------------------------------------------------------------------
-
-wxIDirectFBSurfacePtr wxDfbCreateCompatibleSurface(
-                                    const wxIDirectFBSurfacePtr& s,
-                                    const wxSize& size)
-{
-    if ( !s )
-        return NULL;
-
-    DFBSurfaceDescription desc;
-    desc.flags = (DFBSurfaceDescriptionFlags)(
-            DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT);
-    s->GetCapabilities(&desc.caps);
-    s->GetPixelFormat(&desc.pixelformat);
-    desc.width = size.x;
-    desc.height = size.y;
-
-    wxIDirectFBSurfacePtr snew(wxIDirectFB::Get()->CreateSurface(&desc));
-    if ( !snew )
-        return NULL;
-
-    if ( desc.pixelformat == DSPF_LUT8 )
-    {
-        wxIDirectFBPalettePtr pal(s->GetPalette());
-        if ( s )
-        {
-            if ( !snew->SetPalette(pal) )
-                return NULL;
-        }
-    }
-
-    return snew;
-}
-
-wxIDirectFBSurfacePtr wxDfbCloneSurface(const wxIDirectFBSurfacePtr& s,
-                                        wxDfbCloneSurfaceMode mode)
-{
-    if ( !s )
-        return NULL;
-
-    wxSize size;
-    if ( !s->GetSize(&size.x, &size.y) )
-        return NULL;
-
-    wxIDirectFBSurfacePtr snew(wxDfbCreateCompatibleSurface(s, size));
-    if ( !snew )
-        return NULL;
-
-    if ( mode == wxDfbCloneSurface_CopyPixels )
-    {
-        if ( !snew->SetBlittingFlags(DSBLIT_NOFX) )
-            return NULL;
-        if ( !snew->Blit(s, NULL, 0, 0) )
-            return NULL;
-    }
-
-    return snew;
-}
-
-int wxDfbGetSurfaceDepth(const wxIDirectFBSurfacePtr& s)
-{
-    wxCHECK_MSG( s, -1, _T("invalid surface") );
-
-    DFBSurfacePixelFormat format = DSPF_UNKNOWN;
-
-    if ( !s->GetPixelFormat(&format) )
-        return -1;
-
-    return DFB_BITS_PER_PIXEL(format);
-}
-
-wxIDirectFBDisplayLayerPtr wxDfbGetDisplayLayer()
-{
-    return wxIDirectFB::Get()->GetDisplayLayer(DLID_PRIMARY);
-}
-
-wxIDirectFBSurfacePtr wxDfbGetPrimarySurface()
-{
-    wxIDirectFBDisplayLayerPtr layer(wxDfbGetDisplayLayer());
-    return layer ? layer->GetSurface() : NULL;
-}
-
 
 //-----------------------------------------------------------------------------
 // mouse
@@ -174,7 +103,7 @@ wxIDirectFBSurfacePtr wxDfbGetPrimarySurface()
 
 void wxGetMousePosition(int *x, int *y)
 {
-    wxIDirectFBDisplayLayerPtr layer(wxDfbGetDisplayLayer());
+    wxIDirectFBDisplayLayerPtr layer(wxIDirectFB::Get()->GetDisplayLayer());
     if ( layer )
         layer->GetCursorPosition(x, y);
 }
@@ -193,7 +122,7 @@ wxPoint wxGetMousePosition()
 bool wxGetKeyState(wxKeyCode key)
 {
     wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key != WXK_MBUTTON,
-                 _T("can't use wxGetKeyState() for mouse buttons"));
+                 "can't use wxGetKeyState() for mouse buttons");
 
     return false; // FIXME
 }
@@ -205,9 +134,3 @@ bool wxGetKeyState(wxKeyCode key)
 void wxBell()
 {
 }
-
-int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
-{
-    wxFAIL_MSG( _T("wxAddProcessCallback not implemented") );
-    return 0;
-}