// Implement Pool of Graphic contexts. Creating them takes too much time.
//-----------------------------------------------------------------------------
-#define GC_POOL_SIZE 200
-
enum wxPoolGCType
{
wxGC_ERROR = 0,
int i_angle = (int) angle;
i_angle = i_angle % 360;
+ if (i_angle < 0)
+ i_angle += 360;
int xoffset = 0;
if ((i_angle >= 90.0) && (i_angle < 270.0))
xoffset = image.GetWidth();
#else
const wxWCharBuffer wdata = wxConvLocal.cMB2WC( string );
if ( !wdata )
- {
- if (width) (*width) = 0;
- if (height) (*height) = 0;
return;
- }
+
const wxCharBuffer data = wxConvUTF8.cWC2MB( wdata );
const char *dataUTF8 = (const char *)data;
#endif
pango_layout_set_text( m_layout, dataUTF8, strlen(dataUTF8) );
- int w,h;
- pango_layout_get_pixel_size( m_layout, &w, &h );
-
- if (width)
- *width = (wxCoord) w;
- if (height)
- *height = (wxCoord) h;
if (descent)
{
+ int h;
+ pango_layout_get_pixel_size( m_layout, width, &h );
PangoLayoutIter *iter = pango_layout_get_iter(m_layout);
int baseline = pango_layout_iter_get_baseline(iter);
pango_layout_iter_free(iter);
*descent = h - PANGO_PIXELS(baseline);
+
+ if (height)
+ *height = (wxCoord) h;
+ }
+ else
+ {
+ pango_layout_get_pixel_size( m_layout, width, height );
}
// Reset old font description
{
#ifdef __WXGTK20__
pango_layout_set_text( m_layout, "H", 1 );
- int w,h;
- pango_layout_get_pixel_size( m_layout, &w, &h );
+ int w;
+ pango_layout_get_pixel_size( m_layout, &w, NULL );
return w;
#else
GdkFont *font = m_font.GetInternalFont( m_scaleY );
{
#ifdef __WXGTK20__
pango_layout_set_text( m_layout, "H", 1 );
- int w,h;
- pango_layout_get_pixel_size( m_layout, &w, &h );
+ int h;
+ pango_layout_get_pixel_size( m_layout, NULL, &h );
return h;
#else
GdkFont *font = m_font.GetInternalFont( m_scaleY );
}
}
-#if (GTK_MINOR_VERSION > 0) || (GTK_MAJOR_VERSION > 1)
if (req_dash && req_nb_dash)
{
wxGTKDash *real_req_dash = new wxGTKDash[req_nb_dash];
gdk_gc_set_dashes( m_penGC, 0, (wxGTKDash*)req_dash, req_nb_dash );
}
}
-#endif // GTK+ > 1.0
GdkCapStyle capStyle = GDK_CAP_ROUND;
switch (m_pen.GetCap())
{
case wxXOR: mode = GDK_XOR; break;
case wxINVERT: mode = GDK_INVERT; break;
-#if (GTK_MINOR_VERSION > 0) || (GTK_MAJOR_VERSION > 1)
case wxOR_REVERSE: mode = GDK_OR_REVERSE; break;
case wxAND_REVERSE: mode = GDK_AND_REVERSE; break;
case wxCLEAR: mode = GDK_CLEAR; break;
// unsupported by GTK
case wxNOR: mode = GDK_COPY; break;
-#endif // GTK+ > 1.0
default:
wxFAIL_MSG( wxT("unsupported logical function") );
mode = GDK_COPY;
int wxWindowDC::GetDepth() const
{
+#ifdef __WXGTK20__
+ return gdk_drawable_get_depth(m_window);
+#else
wxFAIL_MSG(wxT("not implemented"));
return -1;
+#endif
}