gdk_gc_set_background( m_penGC, bg_col );
gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
-
/* m_brushGC */
m_brush.GetColour().CalcPixel( m_cmap );
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
-
/* m_bgGC */
gdk_gc_set_background( m_bgGC, bg_col );
gdk_gc_set_foreground( m_bgGC, bg_col );
}
}
- // To do: Fillstyle
-
if (m_pen.GetStyle() != wxTRANSPARENT)
{
for (i = 0 ; i < n ; i++)
if (m_brush.GetStyle() != wxTRANSPARENT)
{
- gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
- gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
- gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
- gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
- gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
- gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
+ {
+ gdk_gc_set_ts_origin( m_textGC,
+ m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
+ m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
+ gdk_draw_rectangle( m_window, m_textGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+ gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+ gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+ gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+ gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+ gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ gdk_gc_set_ts_origin( m_textGC, 0, 0 );
+ }
+ else if (m_brush.GetStyle() == wxSTIPPLE)
+ {
+ gdk_gc_set_ts_origin( m_brushGC,
+ m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
+ m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ }
+ else
+ {
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ }
}
if (m_pen.GetStyle() != wxTRANSPARENT)
if (m_window)
{
if (m_brush.GetStyle() != wxTRANSPARENT)
- gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+ {
+ if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
+ {
+ gdk_gc_set_ts_origin( m_textGC,
+ m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
+ m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
+ gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+ gdk_gc_set_ts_origin( m_textGC, 0, 0 );
+ }
+ else if (m_brush.GetStyle() == wxSTIPPLE)
+ {
+ gdk_gc_set_ts_origin( m_brushGC,
+ m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
+ m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ }
+ else
+ {
+ gdk_draw_arc( m_window, m_brushGC, TRUE, 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 );
gdk_gc_set_fill( gc, GDK_OPAQUE_STIPPLED );
gdk_gc_set_stipple( gc, mask );
gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, ww, hh );
-/*
- gdk_gc_set_clip_mask( m_brushGC, NULL );
- gdk_gc_set_clip_mask( m_textGC, NULL );
- SetBrush( *wxRED_BRUSH );
- DrawRectangle( 70, 0, 70, 1000 );
- gdk_draw_bitmap( m_window, m_textGC, new_mask, 0, 0, 100, 5, ww, hh );
- gdk_draw_bitmap( m_window, m_textGC, mask, 0, 0, 80, 5, ww, hh );
-*/
gdk_gc_unref( gc );
}
wxBitmap bitmap( width, height );
- if (srcDC->m_isScreenDC)
- gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
-
+ /* copy including child window contents */
+ gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
srcDC->GetWindow(),
xsrc, ysrc, width, height );
-
- if (srcDC->m_isScreenDC)
- gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
+ gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
/* scale image */
-
wxImage image( bitmap );
image = image.Scale( ww, hh );
/* convert to bitmap */
-
bitmap = image.ConvertToBitmap();
/* draw scaled bitmap */
-
gdk_draw_pixmap( m_window, m_penGC, bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 );
}
{
/* No scaling and not a memory dc with a mask either */
- if (srcDC->m_isScreenDC)
- gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
-
+ /* copy including child window contents */
+ gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
gdk_window_copy_area( m_window, m_penGC, xx, yy,
srcDC->GetWindow(),
xsrc, ysrc, width, height );
-
- if (srcDC->m_isScreenDC)
- gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
+ gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
}
}
{
for (int i = 0; i < req_nb_dash; i++)
real_req_dash[i] = req_dash[i] * width;
- gdk_gc_set_dashes( m_penGC, 0, real_req_dash, req_nb_dash );
+#if GTK_CHECK_VERSION(1,2,7)
+ gdk_gc_set_dashes( m_penGC, 0, (gint8*) real_req_dash,
+ req_nb_dash );
+#else
+ gdk_gc_set_dashes( m_penGC, 0, real_req_dash,
+ req_nb_dash );
+#endif
delete[] real_req_dash;
}
else
{
// No Memory. We use non-scaled dash pattern...
+#if GTK_CHECK_VERSION(1,2,7)
+ gdk_gc_set_dashes( m_penGC, 0, (gint8*)req_dash, req_nb_dash );
+#else
gdk_gc_set_dashes( m_penGC, 0, (char*)req_dash, req_nb_dash );
+#endif
}
}
#endif
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
- wxDC::DoSetClippingRegion( x, y, width, height );
-
if (!m_window) return;
wxRect rect;
m_currentClippingRegion.Intersect( m_paintClippingRegion );
#endif
+ wxCoord xx, yy, ww, hh;
+ m_currentClippingRegion.GetBox( xx, yy, ww, hh );
+ wxDC::DoSetClippingRegion( xx, yy, ww, hh );
+
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
return;
}
- wxCoord x,y,w,h;
- region.GetBox( x, y, w, h );
-
- wxDC::DoSetClippingRegion( x, y, w, h );
-
if (!m_window) return;
if (!m_currentClippingRegion.IsNull())
m_currentClippingRegion.Intersect( m_paintClippingRegion );
#endif
+ wxCoord xx, yy, ww, hh;
+ m_currentClippingRegion.GetBox( xx, yy, ww, hh );
+ wxDC::DoSetClippingRegion( xx, yy, ww, hh );
+
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
wxPaintDC::wxPaintDC( wxWindow *win )
: wxWindowDC( win )
{
-#if USE_PAINT_REGION
+#if USE_PAINT_REGION
+ if (!win->m_clipPaintRegion)
+ return;
+
m_paintClippingRegion = win->GetUpdateRegion();
m_currentClippingRegion.Union( m_paintClippingRegion );