-void wxWindowDC::SetUpDC()
-{
- m_ok = TRUE;
-
- if (!m_penGC)
- {
- m_penGC = wxGetPoolGC( m_window );
- m_brushGC = wxGetPoolGC( m_window );
- m_textGC = wxGetPoolGC( m_window );
- m_bgGC = wxGetPoolGC( m_window );
- }
-
- /* background colour */
- m_backgroundBrush = *wxWHITE_BRUSH;
- m_backgroundBrush.GetColour().CalcPixel( m_cmap );
- GdkColor *bg_col = m_backgroundBrush.GetColour().GetColor();
-
- /* m_textGC */
- m_textForegroundColour.CalcPixel( m_cmap );
- gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
-
- m_textBackgroundColour.CalcPixel( m_cmap );
- gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() );
-
- gdk_gc_set_fill( m_textGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_textGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
-
- /* m_penGC */
- m_pen.GetColour().CalcPixel( m_cmap );
- gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() );
- gdk_gc_set_background( m_penGC, bg_col );
-
- gdk_gc_set_fill( m_penGC, GDK_SOLID );
- 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_foreground( m_brushGC, m_brush.GetColour().GetColor() );
- gdk_gc_set_background( m_brushGC, bg_col );
-
- gdk_gc_set_fill( m_brushGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_brushGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
-
-
- /* m_bgGC */
- gdk_gc_set_background( m_bgGC, bg_col );
- gdk_gc_set_foreground( m_bgGC, bg_col );
-
- gdk_gc_set_fill( m_bgGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_bgGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
-
- /* ROPs */
- gdk_gc_set_function( m_textGC, GDK_COPY );
- gdk_gc_set_function( m_brushGC, GDK_COPY );
- gdk_gc_set_function( m_penGC, GDK_COPY );
- gdk_gc_set_function( m_bgGC, 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 );
-
- 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 );
- }
-}
-