// The realloc failed. Fall through to error.
wxFAIL_MSG( wxT("No GC available") );
- return (GdkGC*) NULL;
+ return NULL;
}
static void wxFreePoolGC( GdkGC *gc )
wxWindowDCImpl::wxWindowDCImpl(wxDC *owner)
: wxGTKDCImpl(owner)
{
- m_penGC = (GdkGC *) NULL;
- m_brushGC = (GdkGC *) NULL;
- m_textGC = (GdkGC *) NULL;
- m_bgGC = (GdkGC *) NULL;
- m_cmap = (GdkColormap *) NULL;
+ m_penGC = NULL;
+ m_brushGC = NULL;
+ m_textGC = NULL;
+ m_bgGC = NULL;
+ m_cmap = NULL;
m_isMemDC = false;
m_isScreenDC = false;
- m_owner = (wxWindow *)NULL;
+ m_owner = NULL;
}
wxWindowDCImpl::wxWindowDCImpl(wxDC *owner, wxWindow *window)
{
wxASSERT_MSG( window, wxT("DC needs a window") );
- m_penGC = (GdkGC *) NULL;
- m_brushGC = (GdkGC *) NULL;
- m_textGC = (GdkGC *) NULL;
- m_bgGC = (GdkGC *) NULL;
- m_cmap = (GdkColormap *) NULL;
- m_owner = (wxWindow *)NULL;
+ m_penGC = NULL;
+ m_brushGC = NULL;
+ m_textGC = NULL;
+ m_bgGC = NULL;
+ m_cmap = NULL;
+ m_owner = NULL;
m_isMemDC = false;
m_isScreenDC = false;
m_font = window->GetFont();
gdk_gc_set_function( m_penGC, GDK_COPY );
/* clipping */
- gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL );
- gdk_gc_set_clip_rectangle( m_brushGC, (GdkRectangle *) NULL );
- gdk_gc_set_clip_rectangle( m_textGC, (GdkRectangle *) NULL );
- gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL );
+ gdk_gc_set_clip_rectangle( m_penGC, NULL );
+ gdk_gc_set_clip_rectangle( m_brushGC, NULL );
+ gdk_gc_set_clip_rectangle( m_textGC, NULL );
+ gdk_gc_set_clip_rectangle( m_bgGC, NULL );
if (!hatch_bitmap)
{
hatch_bitmap = hatches;
- hatch_bitmap[0] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, bdiag_bits, bdiag_width, bdiag_height );
- hatch_bitmap[1] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cdiag_bits, cdiag_width, cdiag_height );
- hatch_bitmap[2] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, fdiag_bits, fdiag_width, fdiag_height );
- hatch_bitmap[3] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cross_bits, cross_width, cross_height );
- hatch_bitmap[4] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, horiz_bits, horiz_width, horiz_height );
- hatch_bitmap[5] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, verti_bits, verti_width, verti_height );
+ hatch_bitmap[0] = gdk_bitmap_create_from_data( NULL, bdiag_bits, bdiag_width, bdiag_height );
+ hatch_bitmap[1] = gdk_bitmap_create_from_data( NULL, cdiag_bits, cdiag_width, cdiag_height );
+ hatch_bitmap[2] = gdk_bitmap_create_from_data( NULL, fdiag_bits, fdiag_width, fdiag_height );
+ hatch_bitmap[3] = gdk_bitmap_create_from_data( NULL, cross_bits, cross_width, cross_height );
+ hatch_bitmap[4] = gdk_bitmap_create_from_data( NULL, horiz_bits, horiz_width, horiz_height );
+ hatch_bitmap[5] = gdk_bitmap_create_from_data( NULL, verti_bits, verti_width, verti_height );
}
}
}
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
- const wxColour & col, int style);
+ const wxColour & col, wxFloodFillStyle style);
bool wxWindowDCImpl::DoFloodFill(wxCoord x, wxCoord y,
- const wxColour& col, int style)
+ const wxColour& col, wxFloodFillStyle style)
{
return wxDoFloodFill(GetOwner(), x, y, col, style);
}
delete[] gpts;
}
-void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) )
+void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode WXUNUSED(fillStyle) )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
use_bitmap.GetPixmap();
// apply mask if any
- GdkBitmap *mask = (GdkBitmap *) NULL;
+ GdkBitmap *mask = NULL;
if (use_bitmap.GetMask()) mask = use_bitmap.GetMask()->GetBitmap();
- GdkBitmap *new_mask = (GdkBitmap*) NULL;
+ GdkBitmap *new_mask = NULL;
if (useMask && mask)
{
{
if (is_mono)
{
- gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_mask( m_textGC, NULL );
gdk_gc_set_clip_origin( m_textGC, 0, 0 );
if (!m_currentClippingRegion.IsNull())
gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
}
else
{
- gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_mask( m_penGC, NULL );
gdk_gc_set_clip_origin( m_penGC, 0, 0 );
if (!m_currentClippingRegion.IsNull())
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
- int logical_func,
+ wxRasterOperationMode logical_func,
bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask )
{
wxCHECK_MSG( srcDC, false, "source must be a window DC" );
// FIXME: this cast is not always valid, see the code using m_isMemDC
- wxMemoryDCImpl *memDC = wx_static_cast(wxMemoryDCImpl *, srcDC);
+ wxMemoryDCImpl *memDC = static_cast<wxMemoryDCImpl *>(srcDC);
bool use_bitmap_method = false;
bool is_mono = false;
return true;
}
- int old_logical_func = m_logicalFunction;
+ wxRasterOperationMode old_logical_func = m_logicalFunction;
SetLogicalFunction( logical_func );
if (use_bitmap_method)
}
// apply mask if any
- GdkBitmap *mask = (GdkBitmap *) NULL;
+ GdkBitmap *mask = NULL;
if (use_bitmap.GetMask()) mask = use_bitmap.GetMask()->GetBitmap();
- GdkBitmap *new_mask = (GdkBitmap*) NULL;
+ GdkBitmap *new_mask = NULL;
if (useMask && mask)
{
{
if (is_mono)
{
- gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_mask( m_textGC, NULL );
gdk_gc_set_clip_origin( m_textGC, 0, 0 );
if (!m_currentClippingRegion.IsNull())
gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
}
else
{
- gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_mask( m_penGC, NULL );
gdk_gc_set_clip_origin( m_penGC, 0, 0 );
if (!m_currentClippingRegion.IsNull())
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
default:
{
lineStyle = GDK_LINE_SOLID;
- req_dash = (wxGTKDash*)NULL;
+ req_dash = NULL;
req_nb_dash = 0;
break;
}
}
}
-void wxWindowDCImpl::SetLogicalFunction( int function )
+void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() );
}
-void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion )
+void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_currentClippingRegion.IsEmpty())
{
- gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL );
- gdk_gc_set_clip_rectangle( m_brushGC, (GdkRectangle *) NULL );
- gdk_gc_set_clip_rectangle( m_textGC, (GdkRectangle *) NULL );
- gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL );
+ gdk_gc_set_clip_rectangle( m_penGC, NULL );
+ gdk_gc_set_clip_rectangle( m_brushGC, NULL );
+ gdk_gc_set_clip_rectangle( m_textGC, NULL );
+ gdk_gc_set_clip_rectangle( m_bgGC, NULL );
}
else
{
void wxWindowDCImpl::Destroy()
{
if (m_penGC) wxFreePoolGC( m_penGC );
- m_penGC = (GdkGC*) NULL;
+ m_penGC = NULL;
if (m_brushGC) wxFreePoolGC( m_brushGC );
- m_brushGC = (GdkGC*) NULL;
+ m_brushGC = NULL;
if (m_textGC) wxFreePoolGC( m_textGC );
- m_textGC = (GdkGC*) NULL;
+ m_textGC = NULL;
if (m_bgGC) wxFreePoolGC( m_bgGC );
- m_bgGC = (GdkGC*) NULL;
+ m_bgGC = NULL;
}
void wxWindowDCImpl::ComputeScaleAndOrigin()