#include "wx/dcclient.h"
#include "wx/dcmemory.h"
#include "wx/image.h"
+#include "wx/gtk/win_gtk.h"
#include <math.h> // for floating-point functions
#include "gdk/gdk.h"
m_isMemDC = FALSE;
m_font = window->GetFont();
- wxASSERT_MSG( window, _T("DC needs a window") );
+ wxASSERT_MSG( window, wxT("DC needs a window") );
GtkWidget *widget = window->m_wxwindow;
- wxASSERT_MSG( widget, _T("DC needs a widget") );
+ wxASSERT_MSG( widget, wxT("DC needs a widget") );
- m_window = widget->window;
+ GtkMyFixed *myfixed = GTK_MYFIXED( widget );
+ m_window = myfixed->bin_window;
/* not realized ? */
if (!m_window)
void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
{
- wxFAIL_MSG( _T("wxWindowDC::DoFloodFill not implemented") );
+ wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
}
bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
- wxFAIL_MSG( _T("wxWindowDC::DoGetPixel not implemented") );
+ wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
return FALSE;
}
void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
void wxWindowDC::DoCrossHair( long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
long xc, long yc )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
long yyc = YLOG2DEV(yc);
double dx = xx1 - xxc;
double dy = yy1 - yyc;
- double radius = sqrt(dx*dx+dy*dy);
+ double radius = sqrt((double)(dx*dx+dy*dy));
long r = (long)radius;
double radius1, radius2;
void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DoDrawPoint( long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) return;
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (n <= 0) return;
void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long x, long y,
bool useMask )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
- wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") );
/* scale/translate size and position */
of the source dc, but scales correctly on the target dc and
knows about possible mask information in a memory dc. */
- wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") );
+ wxCHECK_MSG( Ok(), FALSE, wxT("invalid window dc") );
- wxCHECK_MSG( source, FALSE, _T("invalid source dc") );
+ wxCHECK_MSG( source, FALSE, wxT("invalid source dc") );
if (!m_window) return FALSE;
void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (!m_window) return;
void wxWindowDC::Clear()
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (!m_window) return;
void wxWindowDC::SetPen( const wxPen &pen )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_pen == pen) return;
void wxWindowDC::SetBrush( const wxBrush &brush )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_brush == brush) return;
/* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch brush */
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_backgroundBrush == brush) return;
void wxWindowDC::SetLogicalFunction( int function )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_logicalFunction == function) return;
#endif
default:
{
- wxFAIL_MSG( _T("unsupported logical function") );
+ wxFAIL_MSG( wxT("unsupported logical function") );
break;
}
}
void wxWindowDC::SetTextForeground( const wxColour &col )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_textForegroundColour == col) return;
void wxWindowDC::SetTextBackground( const wxColour &col )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_textBackgroundColour == col) return;
void wxWindowDC::SetBackgroundMode( int mode )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
m_backgroundMode = mode;
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{
- wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") );
+ wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
}
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
wxDC::DoSetClippingRegion( x, y, width, height );
void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (region.Empty())
{
void wxWindowDC::DestroyClippingRegion()
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
wxDC::DestroyClippingRegion();
int wxWindowDC::GetDepth() const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(wxT("not implemented"));
return -1;
}
void wxWindowDC::DoDrawSpline( wxList *points )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), wxT("invalid window dc") );
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;