fixed wxDFB compilation after wxDC-related changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -185,6 +185,18 @@ public:
|
|||||||
// query dimension, colour deps, resolution
|
// query dimension, colour deps, resolution
|
||||||
|
|
||||||
virtual void DoGetSize(int *width, int *height) const = 0;
|
virtual void DoGetSize(int *width, int *height) const = 0;
|
||||||
|
void GetSize(int *width, int *height) const
|
||||||
|
{
|
||||||
|
return DoGetSize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSize GetSize() const
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
DoGetSize(&w, &h);
|
||||||
|
return wxSize(w, h);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const = 0;
|
virtual void DoGetSizeMM(int* width, int* height) const = 0;
|
||||||
|
|
||||||
virtual int GetDepth() const = 0;
|
virtual int GetDepth() const = 0;
|
||||||
@@ -570,13 +582,8 @@ public:
|
|||||||
|
|
||||||
void GetSize(int *width, int *height) const
|
void GetSize(int *width, int *height) const
|
||||||
{ m_pimpl->DoGetSize(width, height); }
|
{ m_pimpl->DoGetSize(width, height); }
|
||||||
|
|
||||||
wxSize GetSize() const
|
wxSize GetSize() const
|
||||||
{
|
{ return m_pimpl->GetSize(); }
|
||||||
int w, h;
|
|
||||||
m_pimpl->DoGetSize(&w, &h);
|
|
||||||
return wxSize(w, h);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetSizeMM(int* width, int* height) const
|
void GetSizeMM(int* width, int* height) const
|
||||||
{ m_pimpl->DoGetSizeMM(width, height); }
|
{ m_pimpl->DoGetSizeMM(width, height); }
|
||||||
|
@@ -13,23 +13,28 @@
|
|||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/region.h"
|
#include "wx/region.h"
|
||||||
|
#include "wx/dc.h"
|
||||||
#include "wx/dfb/dfbptr.h"
|
#include "wx/dfb/dfbptr.h"
|
||||||
|
|
||||||
wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
|
wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDC
|
// wxDFBDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxDC : public wxDCBase
|
class WXDLLIMPEXP_CORE wxDFBDCImpl : public wxDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDC();
|
// ctors
|
||||||
|
wxDFBDCImpl(wxDC *owner) : wxDCImpl(owner) { m_surface = NULL; }
|
||||||
|
wxDFBDCImpl(wxDC *owner, const wxIDirectFBSurfacePtr& surface)
|
||||||
|
: wxDCImpl(owner)
|
||||||
|
{
|
||||||
|
DFBInit(surface);
|
||||||
|
}
|
||||||
|
|
||||||
// Ctor.
|
bool IsOk() const { return m_surface != NULL; }
|
||||||
wxDC(const wxIDirectFBSurfacePtr& surface);
|
|
||||||
|
|
||||||
public:
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|
||||||
@@ -158,7 +163,7 @@ protected:
|
|||||||
|
|
||||||
friend class WXDLLIMPEXP_FWD_CORE wxOverlayImpl; // for Init
|
friend class WXDLLIMPEXP_FWD_CORE wxOverlayImpl; // for Init
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxDC)
|
DECLARE_ABSTRACT_CLASS(wxDFBDCImpl)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_DFB_DC_H_
|
#endif // _WX_DFB_DC_H_
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: wx/dfb/dcclient.h
|
// Name: wx/dfb/dcclient.h
|
||||||
// Purpose: wxWindowDC, wxClientDC and wxPaintDC
|
// Purpose: wxWindowDCImpl, wxClientDCImpl and wxPaintDCImpl
|
||||||
// Author: Vaclav Slavik
|
// Author: Vaclav Slavik
|
||||||
// Created: 2006-08-10
|
// Created: 2006-08-10
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
@@ -11,20 +11,20 @@
|
|||||||
#ifndef _WX_DFB_DCCLIENT_H_
|
#ifndef _WX_DFB_DCCLIENT_H_
|
||||||
#define _WX_DFB_DCCLIENT_H_
|
#define _WX_DFB_DCCLIENT_H_
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dfb/dc.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxWindowDC
|
// wxWindowDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
|
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxDFBDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxWindowDC() : m_shouldFlip(false) {}
|
wxWindowDCImpl(wxDC *owner) : wxDFBDCImpl(owner), m_shouldFlip(false) { }
|
||||||
wxWindowDC(wxWindow *win);
|
wxWindowDCImpl(wxDC *owner, wxWindow *win);
|
||||||
virtual ~wxWindowDC();
|
virtual ~wxWindowDCImpl();
|
||||||
|
|
||||||
virtual wxWindow *GetWindow() const { return m_win; }
|
virtual wxWindow *GetWindow() const { return m_win; }
|
||||||
|
|
||||||
@@ -41,37 +41,37 @@ private:
|
|||||||
|
|
||||||
friend class wxOverlayImpl; // for m_shouldFlip;
|
friend class wxOverlayImpl; // for m_shouldFlip;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
DECLARE_DYNAMIC_CLASS(wxWindowDCImpl)
|
||||||
DECLARE_NO_COPY_CLASS(wxWindowDC)
|
DECLARE_NO_COPY_CLASS(wxWindowDCImpl)
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxClientDC
|
// wxClientDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
|
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxClientDC() {}
|
wxClientDCImpl(wxDC *owner) : wxWindowDCImpl(owner) { }
|
||||||
wxClientDC(wxWindow *win);
|
wxClientDCImpl(wxDC *owner, wxWindow *win);
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
DECLARE_DYNAMIC_CLASS(wxClientDCImpl)
|
||||||
DECLARE_NO_COPY_CLASS(wxClientDC)
|
DECLARE_NO_COPY_CLASS(wxClientDCImpl)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxPaintDC
|
// wxPaintDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
|
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPaintDC() {}
|
wxPaintDCImpl(wxDC *owner) : wxClientDCImpl(owner) { }
|
||||||
wxPaintDC(wxWindow *win) : wxClientDC(win) {}
|
wxPaintDCImpl(wxDC *owner, wxWindow *win) : wxClientDCImpl(owner, win) { }
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
DECLARE_DYNAMIC_CLASS(wxPaintDCImpl)
|
||||||
DECLARE_NO_COPY_CLASS(wxPaintDC)
|
DECLARE_NO_COPY_CLASS(wxPaintDCImpl)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_DFB_DCCLIENT_H_
|
#endif // _WX_DFB_DCCLIENT_H_
|
||||||
|
@@ -11,21 +11,30 @@
|
|||||||
#ifndef _WX_DFB_DCMEMORY_H_
|
#ifndef _WX_DFB_DCMEMORY_H_
|
||||||
#define _WX_DFB_DCMEMORY_H_
|
#define _WX_DFB_DCMEMORY_H_
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dfb/dc.h"
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxMemoryDC : public wxDC, public wxMemoryDCBase
|
class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxDFBDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxMemoryDC() { Init(); }
|
wxMemoryDCImpl(wxMemoryDC *owner)
|
||||||
wxMemoryDC(wxBitmap& bitmap) { Init(); SelectObject(bitmap); }
|
: wxDFBDCImpl(owner)
|
||||||
wxMemoryDC(wxDC *dc); // create compatible DC
|
{
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
// implementation from now on:
|
wxMemoryDCImpl(wxMemoryDC *owner, wxBitmap& bitmap)
|
||||||
|
: wxDFBDCImpl(owner)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
DoSelect(bitmap);
|
||||||
|
}
|
||||||
|
|
||||||
wxBitmap GetSelectedObject() const { return m_bmp; }
|
wxMemoryDCImpl(wxMemoryDC *owner, wxDC *dc); // create compatible DC
|
||||||
|
|
||||||
protected:
|
// override wxMemoryDC-specific base class virtual methods
|
||||||
|
virtual const wxBitmap& GetSelectedBitmap() const { return m_bmp; }
|
||||||
|
virtual wxBitmap& GetSelectedBitmap() { return m_bmp; }
|
||||||
virtual void DoSelect(const wxBitmap& bitmap);
|
virtual void DoSelect(const wxBitmap& bitmap);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -33,7 +42,7 @@ private:
|
|||||||
|
|
||||||
wxBitmap m_bmp;
|
wxBitmap m_bmp;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
DECLARE_DYNAMIC_CLASS(wxMemoryDCImpl)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_DFB_DCMEMORY_H_
|
#endif // _WX_DFB_DCMEMORY_H_
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: wx/dfb/dcscreen.h
|
// Name: wx/dfb/dcscreen.h
|
||||||
// Purpose: wxScreenDC declaration
|
// Purpose: wxScreenDCImpl declaration
|
||||||
// Author: Vaclav Slavik
|
// Author: Vaclav Slavik
|
||||||
// Created: 2006-08-10
|
// Created: 2006-08-10
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
@@ -11,21 +11,14 @@
|
|||||||
#ifndef _WX_DFB_DCSCREEN_H_
|
#ifndef _WX_DFB_DCSCREEN_H_
|
||||||
#define _WX_DFB_DCSCREEN_H_
|
#define _WX_DFB_DCSCREEN_H_
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dfb/dc.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxScreenDC: public wxDC
|
class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxDFBDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxScreenDC();
|
wxScreenDCImpl(wxScreenDC *owner);
|
||||||
|
|
||||||
static bool StartDrawingOnTop(wxWindow *WXUNUSED(window))
|
DECLARE_DYNAMIC_CLASS(wxScreenDCImpl)
|
||||||
{ return true; }
|
|
||||||
static bool StartDrawingOnTop(wxRect *WXUNUSED(rect) = NULL)
|
|
||||||
{ return true; }
|
|
||||||
static bool EndDrawingOnTop()
|
|
||||||
{ return true; }
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_DFB_DCSCREEN_H_
|
#endif // _WX_DFB_DCSCREEN_H_
|
||||||
|
@@ -191,7 +191,7 @@ private:
|
|||||||
|
|
||||||
friend class wxNonOwnedWindow; // for HandleXXXEvent
|
friend class wxNonOwnedWindow; // for HandleXXXEvent
|
||||||
friend class wxOverlayImpl; // for Add/RemoveOverlay
|
friend class wxOverlayImpl; // for Add/RemoveOverlay
|
||||||
friend class wxWindowDC; // for PaintOverlays
|
friend class wxWindowDCImpl; // for PaintOverlays
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowDFB)
|
DECLARE_DYNAMIC_CLASS(wxWindowDFB)
|
||||||
DECLARE_NO_COPY_CLASS(wxWindowDFB)
|
DECLARE_NO_COPY_CLASS(wxWindowDFB)
|
||||||
|
@@ -66,6 +66,12 @@
|
|||||||
#include "wx/x11/dcscreen.h"
|
#include "wx/x11/dcscreen.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXDFB__
|
||||||
|
#include "wx/dfb/dcclient.h"
|
||||||
|
#include "wx/dfb/dcmemory.h"
|
||||||
|
#include "wx/dfb/dcscreen.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxDCFactory
|
// wxDCFactory
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
216
src/dfb/dc.cpp
216
src/dfb/dc.cpp
@@ -1,6 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: src/dfb/dc.cpp
|
// Name: src/dfb/dc.cpp
|
||||||
// Purpose: wxDC class
|
// Purpose: wxDFBDCImpl class
|
||||||
// Author: Vaclav Slavik
|
// Author: Vaclav Slavik
|
||||||
// Created: 2006-08-07
|
// Created: 2006-08-07
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/dc.h"
|
|
||||||
#include "wx/dcmemory.h"
|
#include "wx/dcmemory.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/dfb/dc.h"
|
||||||
#include "wx/dfb/private.h"
|
#include "wx/dfb/private.h"
|
||||||
|
|
||||||
// these values are used to initialize newly created DC
|
// these values are used to initialize newly created DC
|
||||||
@@ -41,29 +41,17 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDC
|
// wxDFBDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
|
IMPLEMENT_ABSTRACT_CLASS(wxDFBDCImpl, wxDCImpl)
|
||||||
|
|
||||||
// Default constructor
|
void wxDFBDCImpl::DFBInit(const wxIDirectFBSurfacePtr& surface)
|
||||||
wxDC::wxDC()
|
|
||||||
{
|
{
|
||||||
m_ok = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxDC::wxDC(const wxIDirectFBSurfacePtr& surface)
|
|
||||||
{
|
|
||||||
DFBInit(surface);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxDC::DFBInit(const wxIDirectFBSurfacePtr& surface)
|
|
||||||
{
|
|
||||||
m_ok = (surface != NULL);
|
|
||||||
wxCHECK_RET( surface != NULL, "invalid surface" );
|
|
||||||
|
|
||||||
m_surface = surface;
|
m_surface = surface;
|
||||||
|
|
||||||
|
wxCHECK_RET( surface != NULL, "invalid surface" );
|
||||||
|
|
||||||
m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() /
|
m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() /
|
||||||
(double)wxGetDisplaySizeMM().GetWidth();
|
(double)wxGetDisplaySizeMM().GetWidth();
|
||||||
m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() /
|
m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() /
|
||||||
@@ -79,9 +67,9 @@ void wxDC::DFBInit(const wxIDirectFBSurfacePtr& surface)
|
|||||||
// clipping
|
// clipping
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
|
void wxDFBDCImpl::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxSize size(GetSize());
|
wxSize size(GetSize());
|
||||||
|
|
||||||
@@ -107,15 +95,15 @@ void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
|
|||||||
m_clipping = true;
|
m_clipping = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
|
void wxDFBDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region)
|
||||||
{
|
{
|
||||||
// NB: this can be done because wxDFB only supports rectangular regions
|
// NB: this can be done because wxDFB only supports rectangular regions
|
||||||
SetClippingRegion(region.AsRect());
|
GetOwner()->SetClippingRegion(region.AsRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DestroyClippingRegion()
|
void wxDFBDCImpl::DestroyClippingRegion()
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
m_surface->SetClip(NULL);
|
m_surface->SetClip(NULL);
|
||||||
|
|
||||||
@@ -126,7 +114,7 @@ void wxDC::DestroyClippingRegion()
|
|||||||
// query capabilities
|
// query capabilities
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
int wxDC::GetDepth() const
|
int wxDFBDCImpl::GetDepth() const
|
||||||
{
|
{
|
||||||
return m_surface->GetDepth();
|
return m_surface->GetDepth();
|
||||||
}
|
}
|
||||||
@@ -135,9 +123,9 @@ int wxDC::GetDepth() const
|
|||||||
// drawing
|
// drawing
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::Clear()
|
void wxDFBDCImpl::Clear()
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
if ( m_backgroundBrush.GetStyle() == wxTRANSPARENT )
|
if ( m_backgroundBrush.GetStyle() == wxTRANSPARENT )
|
||||||
return;
|
return;
|
||||||
@@ -153,30 +141,37 @@ void wxDC::Clear()
|
|||||||
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
|
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
|
||||||
const wxColour & col, int style);
|
const wxColour & col, int style);
|
||||||
|
|
||||||
bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
|
bool wxDFBDCImpl::DoFloodFill(wxCoord x, wxCoord y,
|
||||||
const wxColour& col, int style)
|
const wxColour& col, int style)
|
||||||
{
|
{
|
||||||
return wxDoFloodFill(this, x, y, col, style);
|
return wxDoFloodFill(GetOwner(), x, y, col, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
|
bool wxDFBDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( col, false, "NULL colour parameter in wxDC::GetPixel");
|
wxCHECK_MSG( col, false, "NULL colour parameter in wxDFBDCImpl::GetPixel");
|
||||||
|
|
||||||
wxFAIL_MSG( "GetPixel not implemented" );
|
wxFAIL_MSG( "GetPixel not implemented" );
|
||||||
|
|
||||||
|
wxUnusedVar(x);
|
||||||
|
wxUnusedVar(y);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
|
void wxDFBDCImpl::DoCrossHair(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "CrossHair not implemented" );
|
wxFAIL_MSG( "CrossHair not implemented" );
|
||||||
|
|
||||||
|
wxUnusedVar(x);
|
||||||
|
wxUnusedVar(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
void wxDFBDCImpl::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
if ( m_pen.GetStyle() == wxTRANSPARENT )
|
if ( m_pen.GetStyle() == wxTRANSPARENT )
|
||||||
return;
|
return;
|
||||||
@@ -214,18 +209,18 @@ void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
|||||||
|
|
||||||
// Draws an arc of a circle, centred on (xc, yc), with starting point (x1, y1)
|
// Draws an arc of a circle, centred on (xc, yc), with starting point (x1, y1)
|
||||||
// and ending at (x2, y2)
|
// and ending at (x2, y2)
|
||||||
void wxDC::DoDrawArc(wxCoord x1, wxCoord y1,
|
void wxDFBDCImpl::DoDrawArc(wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1),
|
||||||
wxCoord x2, wxCoord y2,
|
wxCoord WXUNUSED(x2), wxCoord WXUNUSED(y2),
|
||||||
wxCoord xc, wxCoord yc)
|
wxCoord WXUNUSED(xc), wxCoord WXUNUSED(yc))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "DrawArc not implemented" );
|
wxFAIL_MSG( "DrawArc not implemented" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
|
void wxDFBDCImpl::DoDrawPoint(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
// NB: DirectFB API doesn't provide a function for drawing points, so
|
// NB: DirectFB API doesn't provide a function for drawing points, so
|
||||||
// implement it as 1px long line. This is inefficient, but then, so is
|
// implement it as 1px long line. This is inefficient, but then, so is
|
||||||
@@ -235,24 +230,27 @@ void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
|
|||||||
// FIXME_DFB: implement special cases for common formats (RGB24,RGBA/RGB32)
|
// FIXME_DFB: implement special cases for common formats (RGB24,RGBA/RGB32)
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int WXUNUSED(fillStyle))
|
void wxDFBDCImpl::DoDrawPolygon(int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
||||||
|
wxCoord WXUNUSED(xoffset), wxCoord WXUNUSED(yoffset),
|
||||||
|
int WXUNUSED(fillStyle))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "DrawPolygon not implemented" );
|
wxFAIL_MSG( "DrawPolygon not implemented" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
void wxDFBDCImpl::DoDrawLines(int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
||||||
|
wxCoord WXUNUSED(xoffset), wxCoord WXUNUSED(yoffset))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
// TODO: impl. using DirectDB's DrawLines
|
// TODO: impl. using DirectDB's DrawLines
|
||||||
wxFAIL_MSG( "DrawLines not implemented" );
|
wxFAIL_MSG( "DrawLines not implemented" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
void wxDFBDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxCoord xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
wxCoord yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
@@ -290,30 +288,42 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
CalcBoundingBox(x + width, y + height);
|
CalcBoundingBox(x + width, y + height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
|
void wxDFBDCImpl::DoDrawRoundedRectangle(wxCoord WXUNUSED(x),
|
||||||
|
wxCoord WXUNUSED(y),
|
||||||
|
wxCoord WXUNUSED(width),
|
||||||
|
wxCoord WXUNUSED(height),
|
||||||
|
double WXUNUSED(radius))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "DrawRoundedRectangle not implemented" );
|
wxFAIL_MSG( "DrawRoundedRectangle not implemented" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
void wxDFBDCImpl::DoDrawEllipse(wxCoord WXUNUSED(x),
|
||||||
|
wxCoord WXUNUSED(y),
|
||||||
|
wxCoord WXUNUSED(width),
|
||||||
|
wxCoord WXUNUSED(height))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "DrawElipse not implemented" );
|
wxFAIL_MSG( "DrawElipse not implemented" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
|
void wxDFBDCImpl::DoDrawEllipticArc(wxCoord WXUNUSED(x),
|
||||||
|
wxCoord WXUNUSED(y),
|
||||||
|
wxCoord WXUNUSED(w),
|
||||||
|
wxCoord WXUNUSED(h),
|
||||||
|
double WXUNUSED(sa),
|
||||||
|
double WXUNUSED(ea))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "DrawElipticArc not implemented" );
|
wxFAIL_MSG( "DrawElipticArc not implemented" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
void wxDFBDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxCoord xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
wxCoord yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
@@ -321,7 +331,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
|||||||
// update the bounding box
|
// update the bounding box
|
||||||
wxCoord w, h;
|
wxCoord w, h;
|
||||||
CalcBoundingBox(x, y);
|
CalcBoundingBox(x, y);
|
||||||
GetTextExtent(text, &w, &h);
|
DoGetTextExtent(text, &w, &h);
|
||||||
CalcBoundingBox(x + w, y + h);
|
CalcBoundingBox(x + w, y + h);
|
||||||
|
|
||||||
// if background mode is solid, DrawText must paint text's background:
|
// if background mode is solid, DrawText must paint text's background:
|
||||||
@@ -345,11 +355,11 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
|||||||
SelectColour(m_pen.GetColour());
|
SelectColour(m_pen.GetColour());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawRotatedText(const wxString& text,
|
void wxDFBDCImpl::DoDrawRotatedText(const wxString& WXUNUSED(text),
|
||||||
wxCoord x, wxCoord y,
|
wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||||
double angle)
|
double WXUNUSED(angle))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "DrawRotatedText not implemented" );
|
wxFAIL_MSG( "DrawRotatedText not implemented" );
|
||||||
}
|
}
|
||||||
@@ -358,36 +368,36 @@ void wxDC::DoDrawRotatedText(const wxString& text,
|
|||||||
// set GDI objects
|
// set GDI objects
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::SetPen(const wxPen& pen)
|
void wxDFBDCImpl::SetPen(const wxPen& pen)
|
||||||
{
|
{
|
||||||
m_pen = pen.Ok() ? pen : DEFAULT_PEN;
|
m_pen = pen.Ok() ? pen : DEFAULT_PEN;
|
||||||
|
|
||||||
SelectColour(m_pen.GetColour());
|
SelectColour(m_pen.GetColour());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetBrush(const wxBrush& brush)
|
void wxDFBDCImpl::SetBrush(const wxBrush& brush)
|
||||||
{
|
{
|
||||||
m_brush = brush.Ok() ? brush : DEFAULT_BRUSH;
|
m_brush = brush.Ok() ? brush : DEFAULT_BRUSH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SelectColour(const wxColour& clr)
|
void wxDFBDCImpl::SelectColour(const wxColour& clr)
|
||||||
{
|
{
|
||||||
m_surface->SetColor(clr.Red(), clr.Green(), clr.Blue(), clr.Alpha());
|
m_surface->SetColor(clr.Red(), clr.Green(), clr.Blue(), clr.Alpha());
|
||||||
#warning "use SetColorIndex?"
|
#warning "use SetColorIndex?"
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
void wxDC::SetPalette(const wxPalette& WXUNUSED(palette))
|
void wxDFBDCImpl::SetPalette(const wxPalette& WXUNUSED(palette))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFAIL_MSG( "SetPalette not implemented" );
|
wxFAIL_MSG( "SetPalette not implemented" );
|
||||||
}
|
}
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
void wxDC::SetFont(const wxFont& font)
|
void wxDFBDCImpl::SetFont(const wxFont& font)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
wxFont f(font.Ok() ? font : DEFAULT_FONT);
|
wxFont f(font.Ok() ? font : DEFAULT_FONT);
|
||||||
|
|
||||||
@@ -402,29 +412,29 @@ void wxDC::SetFont(const wxFont& font)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxIDirectFBFontPtr wxDC::GetCurrentFont() const
|
wxIDirectFBFontPtr wxDFBDCImpl::GetCurrentFont() const
|
||||||
{
|
{
|
||||||
bool aa = (GetDepth() > 8);
|
bool aa = (GetDepth() > 8);
|
||||||
return m_font.GetDirectFBFont(aa);
|
return m_font.GetDirectFBFont(aa);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetBackground(const wxBrush& brush)
|
void wxDFBDCImpl::SetBackground(const wxBrush& brush)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
if (!brush.Ok()) return;
|
if (!brush.Ok()) return;
|
||||||
|
|
||||||
m_backgroundBrush = brush;
|
m_backgroundBrush = brush;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetBackgroundMode(int mode)
|
void wxDFBDCImpl::SetBackgroundMode(int mode)
|
||||||
{
|
{
|
||||||
m_backgroundMode = mode;
|
m_backgroundMode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetLogicalFunction(int function)
|
void wxDFBDCImpl::SetLogicalFunction(int function)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
// NB: we could also support XOR, but for blitting only (via DSBLIT_XOR);
|
// NB: we could also support XOR, but for blitting only (via DSBLIT_XOR);
|
||||||
// and possibly others via SetSrc/DstBlendFunction()
|
// and possibly others via SetSrc/DstBlendFunction()
|
||||||
@@ -434,21 +444,21 @@ void wxDC::SetLogicalFunction(int function)
|
|||||||
m_logicalFunction = function;
|
m_logicalFunction = function;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDC::StartDoc(const wxString& WXUNUSED(message))
|
bool wxDFBDCImpl::StartDoc(const wxString& WXUNUSED(message))
|
||||||
{
|
{
|
||||||
// We might be previewing, so return true to let it continue.
|
// We might be previewing, so return true to let it continue.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::EndDoc()
|
void wxDFBDCImpl::EndDoc()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::StartPage()
|
void wxDFBDCImpl::StartPage()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::EndPage()
|
void wxDFBDCImpl::EndPage()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,9 +466,9 @@ void wxDC::EndPage()
|
|||||||
// text metrics
|
// text metrics
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
wxCoord wxDC::GetCharHeight() const
|
wxCoord wxDFBDCImpl::GetCharHeight() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), -1, wxT("invalid dc") );
|
wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") );
|
||||||
wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
|
wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
|
||||||
|
|
||||||
int h = -1;
|
int h = -1;
|
||||||
@@ -466,9 +476,9 @@ wxCoord wxDC::GetCharHeight() const
|
|||||||
return YDEV2LOGREL(h);
|
return YDEV2LOGREL(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCoord wxDC::GetCharWidth() const
|
wxCoord wxDFBDCImpl::GetCharWidth() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), -1, wxT("invalid dc") );
|
wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") );
|
||||||
wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
|
wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
|
||||||
|
|
||||||
int w = -1;
|
int w = -1;
|
||||||
@@ -478,11 +488,11 @@ wxCoord wxDC::GetCharWidth() const
|
|||||||
return YDEV2LOGREL(w);
|
return YDEV2LOGREL(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
void wxDFBDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
||||||
wxCoord *descent, wxCoord *externalLeading,
|
wxCoord *descent, wxCoord *externalLeading,
|
||||||
const wxFont *theFont) const
|
const wxFont *theFont) const
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
wxCHECK_RET( m_font.Ok(), wxT("no font selected") );
|
wxCHECK_RET( m_font.Ok(), wxT("no font selected") );
|
||||||
wxCHECK_RET( !theFont || theFont->Ok(), wxT("invalid font") );
|
wxCHECK_RET( !theFont || theFont->Ok(), wxT("invalid font") );
|
||||||
|
|
||||||
@@ -490,7 +500,7 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
|||||||
if ( theFont != NULL )
|
if ( theFont != NULL )
|
||||||
{
|
{
|
||||||
oldFont = m_font;
|
oldFont = m_font;
|
||||||
wxConstCast(this, wxDC)->SetFont(*theFont);
|
wxConstCast(this, wxDFBDCImpl)->SetFont(*theFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCoord xx = 0, yy = 0;
|
wxCoord xx = 0, yy = 0;
|
||||||
@@ -519,7 +529,7 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
|||||||
if ( externalLeading ) *externalLeading = 0;
|
if ( externalLeading ) *externalLeading = 0;
|
||||||
|
|
||||||
if ( theFont != NULL )
|
if ( theFont != NULL )
|
||||||
wxConstCast(this, wxDC)->SetFont(oldFont);
|
wxConstCast(this, wxDFBDCImpl)->SetFont(oldFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -532,14 +542,14 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
|||||||
// is not currently implemented here; probably makes sense to
|
// is not currently implemented here; probably makes sense to
|
||||||
// switch to Cairo instead of implementing everything for DFB
|
// switch to Cairo instead of implementing everything for DFB
|
||||||
|
|
||||||
void wxDC::DoGetSize(int *w, int *h) const
|
void wxDFBDCImpl::DoGetSize(int *w, int *h) const
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
|
||||||
m_surface->GetSize(w, h);
|
m_surface->GetSize(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoGetSizeMM(int *width, int *height) const
|
void wxDFBDCImpl::DoGetSizeMM(int *width, int *height) const
|
||||||
{
|
{
|
||||||
#warning "move this to common code?"
|
#warning "move this to common code?"
|
||||||
int w = 0;
|
int w = 0;
|
||||||
@@ -549,7 +559,7 @@ void wxDC::DoGetSizeMM(int *width, int *height) const
|
|||||||
if ( height ) *height = int(double(h) / (m_userScaleY*m_mm_to_pix_y));
|
if ( height ) *height = int(double(h) / (m_userScaleY*m_mm_to_pix_y));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxDC::GetPPI() const
|
wxSize wxDFBDCImpl::GetPPI() const
|
||||||
{
|
{
|
||||||
#warning "move this to common code?"
|
#warning "move this to common code?"
|
||||||
return wxSize(int(double(m_mm_to_pix_x) * inches2mm),
|
return wxSize(int(double(m_mm_to_pix_x) * inches2mm),
|
||||||
@@ -561,13 +571,13 @@ wxSize wxDC::GetPPI() const
|
|||||||
// Blitting
|
// Blitting
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
|
bool wxDFBDCImpl::DoBlit(wxCoord xdest, wxCoord ydest,
|
||||||
wxCoord width, wxCoord height,
|
wxCoord width, wxCoord height,
|
||||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop, bool useMask,
|
int rop, bool useMask,
|
||||||
wxCoord xsrcMask, wxCoord ysrcMask)
|
wxCoord xsrcMask, wxCoord ysrcMask)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), false, "invalid dc" );
|
wxCHECK_MSG( IsOk(), false, "invalid dc" );
|
||||||
wxCHECK_MSG( source, false, "invalid source dc" );
|
wxCHECK_MSG( source, false, "invalid source dc" );
|
||||||
|
|
||||||
// NB: we could also support XOR here (via DSBLIT_XOR)
|
// NB: we could also support XOR here (via DSBLIT_XOR)
|
||||||
@@ -596,7 +606,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
|
|||||||
wxMemoryDC *sourceAsMemDC = wxDynamicCast(source, wxMemoryDC);
|
wxMemoryDC *sourceAsMemDC = wxDynamicCast(source, wxMemoryDC);
|
||||||
if ( sourceAsMemDC )
|
if ( sourceAsMemDC )
|
||||||
{
|
{
|
||||||
DoDrawSubBitmap(sourceAsMemDC->GetSelectedObject(),
|
DoDrawSubBitmap(sourceAsMemDC->GetSelectedBitmap(),
|
||||||
xsrc, ysrc,
|
xsrc, ysrc,
|
||||||
width, height,
|
width, height,
|
||||||
xdest, ydest,
|
xdest, ydest,
|
||||||
@@ -605,18 +615,22 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return DoBlitFromSurface(source->GetDirectFBSurface(),
|
return DoBlitFromSurface
|
||||||
|
(
|
||||||
|
static_cast<wxDFBDCImpl *>(source->GetImpl())
|
||||||
|
->GetDirectFBSurface(),
|
||||||
xsrc, ysrc,
|
xsrc, ysrc,
|
||||||
width, height,
|
width, height,
|
||||||
xdest, ydest);
|
xdest, ydest
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
|
void wxDFBDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
|
wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
|
||||||
|
|
||||||
DoDrawSubBitmap(bmp,
|
DoDrawSubBitmap(bmp,
|
||||||
@@ -625,17 +639,17 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
|
|||||||
m_logicalFunction, useMask);
|
m_logicalFunction, useMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
|
void wxDFBDCImpl::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
||||||
DoDrawBitmap((const wxBitmap&)icon, x, y, true);
|
DoDrawBitmap((const wxBitmap&)icon, x, y, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawSubBitmap(const wxBitmap &bmp,
|
void wxDFBDCImpl::DoDrawSubBitmap(const wxBitmap &bmp,
|
||||||
wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||||
wxCoord destx, wxCoord desty, int rop, bool useMask)
|
wxCoord destx, wxCoord desty, int rop, bool useMask)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
|
wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
|
||||||
|
|
||||||
// NB: we could also support XOR here (via DSBLIT_XOR)
|
// NB: we could also support XOR here (via DSBLIT_XOR)
|
||||||
@@ -666,7 +680,7 @@ void wxDC::DoDrawSubBitmap(const wxBitmap &bmp,
|
|||||||
destx, desty);
|
destx, desty);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDC::DoBlitFromSurface(const wxIDirectFBSurfacePtr& src,
|
bool wxDFBDCImpl::DoBlitFromSurface(const wxIDirectFBSurfacePtr& src,
|
||||||
wxCoord srcx, wxCoord srcy,
|
wxCoord srcx, wxCoord srcy,
|
||||||
wxCoord w, wxCoord h,
|
wxCoord w, wxCoord h,
|
||||||
wxCoord dstx, wxCoord dsty)
|
wxCoord dstx, wxCoord dsty)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: src/dfb/dcclient.cpp
|
// Name: src/dfb/dcclient.cpp
|
||||||
// Purpose: wxWindowDC, wxClientDC and wxPaintDC
|
// Purpose: wxWindowDCImpl, wxClientDCImpl and wxPaintDC
|
||||||
// Author: Vaclav Slavik
|
// Author: Vaclav Slavik
|
||||||
// Created: 2006-08-10
|
// Created: 2006-08-10
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
@@ -23,13 +23,12 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dcclient.h"
|
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
#include "wx/nonownedwnd.h"
|
#include "wx/nonownedwnd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/dfb/dcclient.h"
|
||||||
#include "wx/dfb/private.h"
|
#include "wx/dfb/private.h"
|
||||||
|
|
||||||
#define TRACE_PAINT "paint"
|
#define TRACE_PAINT "paint"
|
||||||
@@ -93,17 +92,18 @@ wxIDirectFBSurfacePtr CreateDummySurface(wxWindow *win, const wxRect *rect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxWindowDC
|
// wxWindowDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxWindowDCImpl, wxDFBDCImpl)
|
||||||
|
|
||||||
wxWindowDC::wxWindowDC(wxWindow *win)
|
wxWindowDCImpl::wxWindowDCImpl(wxDC *owner, wxWindow *win)
|
||||||
|
: wxDFBDCImpl(owner)
|
||||||
{
|
{
|
||||||
InitForWin(win, NULL);
|
InitForWin(win, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect)
|
void wxWindowDCImpl::InitForWin(wxWindow *win, const wxRect *rect)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( win, "invalid window" );
|
wxCHECK_RET( win, "invalid window" );
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect)
|
|||||||
SetDeviceOrigin(origin.x, origin.y);
|
SetDeviceOrigin(origin.x, origin.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowDC::~wxWindowDC()
|
wxWindowDCImpl::~wxWindowDCImpl()
|
||||||
{
|
{
|
||||||
wxIDirectFBSurfacePtr surface(GetDirectFBSurface());
|
wxIDirectFBSurfacePtr surface(GetDirectFBSurface());
|
||||||
if ( !surface )
|
if ( !surface )
|
||||||
@@ -227,12 +227,13 @@ wxWindowDC::~wxWindowDC()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxClientDC
|
// wxClientDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxClientDCImpl, wxWindowDCImpl)
|
||||||
|
|
||||||
wxClientDC::wxClientDC(wxWindow *win)
|
wxClientDCImpl::wxClientDCImpl(wxDC *owner, wxWindow *win)
|
||||||
|
: wxWindowDCImpl(owner, win)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( win, "invalid window" );
|
wxCHECK_RET( win, "invalid window" );
|
||||||
|
|
||||||
@@ -244,4 +245,4 @@ wxClientDC::wxClientDC(wxWindow *win)
|
|||||||
// wxPaintDC
|
// wxPaintDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxPaintDCImpl, wxWindowDCImpl)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: src/dfb/dcmemory.cpp
|
// Name: src/dfb/dcmemory.cpp
|
||||||
// Purpose: wxMemoryDC implementation
|
// Purpose: wxMemoryDCImpl implementation
|
||||||
// Author: Vaclav Slavik
|
// Author: Vaclav Slavik
|
||||||
// Created: 2006-08-16
|
// Created: 2006-08-16
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
@@ -19,12 +19,11 @@
|
|||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/dcmemory.h"
|
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/dfb/dcmemory.h"
|
||||||
#include "wx/dfb/private.h"
|
#include "wx/dfb/private.h"
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -32,22 +31,23 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMemoryDC
|
// wxMemoryDCImpl
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#warning "FIXME: verify/fix that wxMemoryDC works correctly with mono bitmaps"
|
#warning "FIXME: verify/fix that wxMemoryDCImpl works correctly with mono bitmaps"
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxDFBDCImpl)
|
||||||
|
|
||||||
void wxMemoryDC::Init()
|
void wxMemoryDCImpl::Init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDC::wxMemoryDC(wxDC *WXUNUSED(dc))
|
wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC *owner, wxDC *WXUNUSED(dc))
|
||||||
|
: wxDFBDCImpl(owner)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMemoryDC::DoSelect(const wxBitmap& bitmap)
|
void wxMemoryDCImpl::DoSelect(const wxBitmap& bitmap)
|
||||||
{
|
{
|
||||||
m_bmp = bitmap;
|
m_bmp = bitmap;
|
||||||
|
|
||||||
|
@@ -19,8 +19,7 @@
|
|||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/dcscreen.h"
|
#include "wx/dfb/dcscreen.h"
|
||||||
|
|
||||||
#include "wx/dfb/private.h"
|
#include "wx/dfb/private.h"
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -34,9 +33,10 @@
|
|||||||
#warning "FIXME: this doesn't work (neither single app nor multiapp core)
|
#warning "FIXME: this doesn't work (neither single app nor multiapp core)
|
||||||
// FIXME: maybe use a subsurface as well?
|
// FIXME: maybe use a subsurface as well?
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxDFBDCImpl)
|
||||||
|
|
||||||
wxScreenDC::wxScreenDC()
|
wxScreenDCImpl::wxScreenDCImpl(wxScreenDC *owner)
|
||||||
|
: wxDFBDCImpl(owner)
|
||||||
{
|
{
|
||||||
DFBInit(wxIDirectFB::Get()->GetPrimarySurface());
|
DFBInit(wxIDirectFB::Get()->GetPrimarySurface());
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/private/overlay.h"
|
#include "wx/private/overlay.h"
|
||||||
|
#include "wx/dfb/dcclient.h"
|
||||||
#include "wx/dfb/private.h"
|
#include "wx/dfb/private.h"
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -57,8 +58,12 @@ bool wxOverlayImpl::IsOk()
|
|||||||
|
|
||||||
void wxOverlayImpl::Init(wxWindowDC *dc, int x, int y, int width, int height)
|
void wxOverlayImpl::Init(wxWindowDC *dc, int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
|
wxCHECK_RET( dc, "NULL dc pointer" );
|
||||||
wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") );
|
wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") );
|
||||||
|
|
||||||
|
wxDFBDCImpl * const dcimpl = wxDynamicCast(dc->GetImpl(), wxDFBDCImpl);
|
||||||
|
wxCHECK_RET( dcimpl, "must have a DFB wxDC" );
|
||||||
|
|
||||||
m_window = dc->GetWindow();
|
m_window = dc->GetWindow();
|
||||||
|
|
||||||
m_rect = wxRect(x, y, width, height);
|
m_rect = wxRect(x, y, width, height);
|
||||||
@@ -66,8 +71,7 @@ void wxOverlayImpl::Init(wxWindowDC *dc, int x, int y, int width, int height)
|
|||||||
m_rect.Offset(m_window->GetClientAreaOrigin());
|
m_rect.Offset(m_window->GetClientAreaOrigin());
|
||||||
|
|
||||||
// FIXME: create surface with transparency or key color (?)
|
// FIXME: create surface with transparency or key color (?)
|
||||||
m_surface =
|
m_surface = dcimpl->GetDirectFBSurface()->CreateCompatible
|
||||||
dc->GetDirectFBSurface()->CreateCompatible
|
|
||||||
(
|
(
|
||||||
m_rect.GetSize(),
|
m_rect.GetSize(),
|
||||||
wxIDirectFBSurface::CreateCompatible_NoBackBuffer
|
wxIDirectFBSurface::CreateCompatible_NoBackBuffer
|
||||||
@@ -78,6 +82,11 @@ void wxOverlayImpl::Init(wxWindowDC *dc, int x, int y, int width, int height)
|
|||||||
|
|
||||||
void wxOverlayImpl::BeginDrawing(wxWindowDC *dc)
|
void wxOverlayImpl::BeginDrawing(wxWindowDC *dc)
|
||||||
{
|
{
|
||||||
|
wxCHECK_RET( dc, "NULL dc pointer" );
|
||||||
|
|
||||||
|
wxWindowDCImpl * const
|
||||||
|
dcimpl = static_cast<wxWindowDCImpl *>(dc->GetImpl());
|
||||||
|
|
||||||
wxPoint origin(m_rect.GetPosition());
|
wxPoint origin(m_rect.GetPosition());
|
||||||
if ( wxDynamicCast(dc, wxClientDC) )
|
if ( wxDynamicCast(dc, wxClientDC) )
|
||||||
origin -= m_window->GetClientAreaOrigin();
|
origin -= m_window->GetClientAreaOrigin();
|
||||||
@@ -86,19 +95,19 @@ void wxOverlayImpl::BeginDrawing(wxWindowDC *dc)
|
|||||||
// another DC, so we have to change the DC to draw on the overlay's surface.
|
// another DC, so we have to change the DC to draw on the overlay's surface.
|
||||||
// Setting m_shouldFlip is done to avoid flipping and drawing of overlays
|
// Setting m_shouldFlip is done to avoid flipping and drawing of overlays
|
||||||
// in ~wxWindowDC (we do it EndDrawing).
|
// in ~wxWindowDC (we do it EndDrawing).
|
||||||
dc->DFBInit(m_surface);
|
dcimpl->DFBInit(m_surface);
|
||||||
|
dcimpl->m_shouldFlip = false;
|
||||||
dc->SetDeviceOrigin(-origin.x, -origin.y);
|
dc->SetDeviceOrigin(-origin.x, -origin.y);
|
||||||
dc->m_shouldFlip = false;
|
|
||||||
|
|
||||||
m_isEmpty = false;
|
m_isEmpty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxOverlayImpl::EndDrawing(wxWindowDC *dc)
|
void wxOverlayImpl::EndDrawing(wxWindowDC *WXUNUSED(dc))
|
||||||
{
|
{
|
||||||
m_window->RefreshWindowRect(m_rect);
|
m_window->RefreshWindowRect(m_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxOverlayImpl::Clear(wxWindowDC *dc)
|
void wxOverlayImpl::Clear(wxWindowDC *WXUNUSED(dc))
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( IsOk(),
|
wxASSERT_MSG( IsOk(),
|
||||||
"You cannot Clear an overlay that is not initialized" );
|
"You cannot Clear an overlay that is not initialized" );
|
||||||
|
Reference in New Issue
Block a user