void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
{
void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
{
if (m_pen.GetStyle() != wxTRANSPARENT)
{
gdk_draw_line( m_window, m_penGC,
XLOG2DEV(x1), YLOG2DEV(y1), XLOG2DEV(x2), YLOG2DEV(y2) );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
gdk_draw_line( m_window, m_penGC,
XLOG2DEV(x1), YLOG2DEV(y1), XLOG2DEV(x2), YLOG2DEV(y2) );
void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc )
{
void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc )
{
void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{
void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{
void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle))
{
void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle))
{
void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
{
void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
{
void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
{
void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
{
void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
{
void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
{
if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 );
if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 );
+ DrawBitmap( icon, x, y, TRUE );
+}
+
+void wxWindowDC::DrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask )
+{
+ wxCHECK_RET( Ok(), "invalid window dc" );
- GdkBitmap *mask = (GdkBitmap *) NULL;
- if (icon.GetMask()) mask = icon.GetMask()->GetBitmap();
+ int w = bitmap.GetWidth();
+ int h = bitmap.GetHeight();
+
+ int ww = XLOG2DEVREL(w);
+ int hh = YLOG2DEVREL(h);
+
+ wxBitmap use_bitmap;
- gdk_gc_set_clip_mask( m_penGC, mask );
- gdk_gc_set_clip_origin( m_penGC, xx, yy );
+ wxImage image( bitmap );
+ image = image.Scale( ww, hh );
+
+ use_bitmap = image.ConvertToBitmap();
-
- GdkPixmap *pm = icon.GetPixmap();
- gdk_draw_pixmap( m_window, m_penGC, pm, 0, 0, xx, yy, -1, -1 );
-
- if (mask)
- CalcBoundingBox( x, y );
- int width = icon.GetWidth();
- int height = icon.GetHeight();
- CalcBoundingBox( x + width, y + height );
-}
-
-void wxWindowDC::DrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask )
-{
- if (!Ok()) return;
-
- if (!bitmap.Ok()) return;
-
- int xx = XLOG2DEV(x);
- int yy = YLOG2DEV(y);
-
gdk_draw_pixmap( m_window, m_penGC, pm, 0, 0, xx, yy, -1, -1 );
if (useMask && mask)
gdk_draw_pixmap( m_window, m_penGC, pm, 0, 0, xx, yy, -1, -1 );
if (useMask && mask)
- int width = bitmap.GetWidth();
- int height = bitmap.GetHeight();
- CalcBoundingBox( x + width, y + height );
+ CalcBoundingBox( x + w, y + h );
}
bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
}
bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
- wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask )
+ wxDC *source, long xsrc, long ysrc, int logical_func, bool useMask )
CalcBoundingBox( xdest, ydest );
CalcBoundingBox( xdest + width, ydest + height );
CalcBoundingBox( xdest, ydest );
CalcBoundingBox( xdest + width, ydest + height );
- gdk_gc_set_clip_mask( m_textGC, mask );
- gdk_gc_set_clip_origin( m_textGC, xx, yy );
+ gdk_gc_set_clip_mask( m_penGC, mask );
+ gdk_gc_set_clip_origin( m_penGC, xx, yy );
- gdk_draw_pixmap( m_window, m_textGC, pmap,
+ gdk_draw_pixmap( m_window, m_penGC, pmap,
source->DeviceToLogicalX(xsrc),
source->DeviceToLogicalY(ysrc),
xx,
source->DeviceToLogicalX(xsrc),
source->DeviceToLogicalY(ysrc),
xx,
- gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
- gdk_gc_set_clip_origin( m_textGC, 0, 0 );
+ gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_origin( m_penGC, 0, 0 );
- gdk_gc_set_clip_mask( m_textGC, mask );
- gdk_gc_set_clip_origin( m_textGC, xx, yy );
+ gdk_gc_set_clip_mask( m_penGC, mask );
+ gdk_gc_set_clip_origin( m_penGC, xx, yy );
}
gdk_draw_bitmap( m_window, m_textGC, bmap,
}
gdk_draw_bitmap( m_window, m_textGC, bmap,
- gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
- gdk_gc_set_clip_origin( m_textGC, 0, 0 );
+ gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_origin( m_penGC, 0, 0 );
XLOG2DEV(xdest), YLOG2DEV(ydest),
csrc->GetWindow(),
source->DeviceToLogicalX(xsrc),
XLOG2DEV(xdest), YLOG2DEV(ydest),
csrc->GetWindow(),
source->DeviceToLogicalX(xsrc),
source->DeviceToLogicalXRel(width),
source->DeviceToLogicalYRel(height) );
source->DeviceToLogicalXRel(width),
source->DeviceToLogicalYRel(height) );
-/*
- gdk_window_copy_area ( m_window, m_textGC,
- XLOG2DEV(xdest), YLOG2DEV(ydest),
- csrc->GetWindow(),
- xsrc, ysrc,
- width, height );
-*/
-
- return TRUE;
+ SetLogicalFunction( old_logical_func );
+ return TRUE;
}
void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) )
{
}
void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) )
{
long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) )
{
long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) )
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX);
}
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX);
}
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY);
}
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY);
}
m_logicalFunction = function;
gdk_gc_set_function( m_penGC, mode );
gdk_gc_set_function( m_brushGC, mode );
m_logicalFunction = function;
gdk_gc_set_function( m_penGC, mode );
gdk_gc_set_function( m_brushGC, mode );
m_backgroundMode = mode;
// CMB 21/7/98: fill style of cross-hatch brushes is affected by
// transparent/solid background mode
m_backgroundMode = mode;
// CMB 21/7/98: fill style of cross-hatch brushes is affected by
// transparent/solid background mode
if (m_brush.GetStyle() != wxSOLID && m_brush.GetStyle() != wxTRANSPARENT)
{
gdk_gc_set_fill( m_brushGC,
if (m_brush.GetStyle() != wxSOLID && m_brush.GetStyle() != wxTRANSPARENT)
{
gdk_gc_set_fill( m_brushGC,
}
void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
{
}
void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
{
wxDC::SetClippingRegion( x, y, width, height );
GdkRectangle rect;
wxDC::SetClippingRegion( x, y, width, height );
GdkRectangle rect;
wxDC::DestroyClippingRegion();
gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL );
wxDC::DestroyClippingRegion();
gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL );
void wx_quadratic_spline(double a1, double b1, double a2, double b2,
double a3, double b3, double a4, double b4);
void wx_quadratic_spline(double a1, double b1, double a2, double b2,
double a3, double b3, double a4, double b4);
int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, double *x3,
double *y3, double *x4, double *y4);
void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3,
int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, double *x3,
double *y3, double *x4, double *y4);
void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3,
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
double x1, y1, x2, y2;
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
double x1, y1, x2, y2;