]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/utils.cpp
Reflect changes in stc.cpp in stc.cpp.in from which it's generated.
[wxWidgets.git] / src / dfb / utils.cpp
index e9e8d8ebbee36c21d802c25c6a77d5215b3e07b8..4c9c853275408a823e747281f628a6e7ee19b379 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     Miscellaneous utility functions and classes
 // Author:      Vaclav Slavik
 // Created:     2006-08-08
-// RCS-ID:      $Id$
 // Copyright:   (c) 2006 REA Elektronik GmbH
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -16,8 +15,9 @@
 #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 +38,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,78 +94,6 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
     wxDisplaySize(width, height);
 }
 
-//-----------------------------------------------------------------------------
-// surface manipulation helpers
-//-----------------------------------------------------------------------------
-
-IDirectFBSurfacePtr wxDfbCloneSurface(const IDirectFBSurfacePtr& s,
-                                      wxDfbCloneSurfaceMode mode)
-{
-    if ( !s )
-        return NULL;
-
-    DFBSurfaceDescription desc;
-    desc.flags = (DFBSurfaceDescriptionFlags)(
-            DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT);
-    s->GetCapabilities(s, &desc.caps);
-    s->GetSize(s, &desc.width, &desc.height);
-    s->GetPixelFormat(s, &desc.pixelformat);
-
-    IDirectFBPtr dfb(wxTheApp->GetDirectFBInterface());
-
-    IDirectFBSurfacePtr snew;
-    if ( !DFB_CALL( dfb->CreateSurface(dfb, &desc, &snew) ) )
-        return NULL;
-
-    IDirectFBPalettePtr pal;
-    if ( s->GetPalette(s, &pal) == DFB_OK )
-    {
-        if ( !DFB_CALL( snew->SetPalette(snew, pal) ) )
-            return NULL;
-    }
-
-    if ( mode == wxDfbCloneSurface_CopyPixels )
-    {
-        if ( !DFB_CALL( snew->SetBlittingFlags(snew, DSBLIT_NOFX) ) )
-            return NULL;
-        if ( !DFB_CALL( snew->Blit(snew, s, NULL, 0, 0) ) )
-            return NULL;
-    }
-
-    return snew;
-}
-
-int wxDfbGetSurfaceDepth(const IDirectFBSurfacePtr& s)
-{
-    wxCHECK_MSG( s, -1, _T("invalid surface") );
-
-    DFBSurfacePixelFormat format = DSPF_UNKNOWN;
-
-    if ( !DFB_CALL( s->GetPixelFormat(s, &format) ) )
-        return -1;
-
-    return DFB_BITS_PER_PIXEL(format);
-}
-
-IDirectFBDisplayLayerPtr wxDfbGetDisplayLayer()
-{
-    IDirectFBPtr dfb(wxTheApp->GetDirectFBInterface());
-
-    IDirectFBDisplayLayerPtr layer;
-    if ( !DFB_CALL( dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer) ) )
-        return NULL;
-
-    return layer;
-}
-
-IDirectFBSurfacePtr wxDfbGetPrimarySurface()
-{
-    IDirectFBDisplayLayerPtr layer(wxDfbGetDisplayLayer());
-    IDirectFBSurfacePtr surface;
-    DFB_CALL( layer->GetSurface(layer, &surface) );
-    return surface;
-}
-
 
 //-----------------------------------------------------------------------------
 // mouse
@@ -162,8 +101,9 @@ IDirectFBSurfacePtr wxDfbGetPrimarySurface()
 
 void wxGetMousePosition(int *x, int *y)
 {
-    IDirectFBDisplayLayerPtr layer(wxDfbGetDisplayLayer());
-    DFB_CALL( layer->GetCursorPosition(layer, x, y) );
+    wxIDirectFBDisplayLayerPtr layer(wxIDirectFB::Get()->GetDisplayLayer());
+    if ( layer )
+        layer->GetCursorPosition(x, y);
 }
 
 wxPoint wxGetMousePosition()
@@ -180,7 +120,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
 }
@@ -192,9 +132,3 @@ bool wxGetKeyState(wxKeyCode key)
 void wxBell()
 {
 }
-
-int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
-{
-    wxFAIL_MSG( _T("wxAddProcessCallback not implemented") );
-    return 0;
-}